diff --git a/administrator/templates/isis/html/layouts/joomla/form/field/media.php b/administrator/templates/isis/html/layouts/joomla/form/field/media.php
index 85ae295eabc17..b44b66ffb077d 100644
--- a/administrator/templates/isis/html/layouts/joomla/form/field/media.php
+++ b/administrator/templates/isis/html/layouts/joomla/form/field/media.php
@@ -11,25 +11,41 @@
/**
* Layout variables
- * ---------------------
+ * -----------------
+ * @var string $autocomplete Autocomplete attribute for the field.
+ * @var boolean $autofocus Is autofocus enabled?
+ * @var string $class Classes for the input.
+ * @var string $description Description of the field.
+ * @var boolean $disabled Is this field disabled?
+ * @var string $group Group the field belongs to. section in form XML.
+ * @var boolean $hidden Is this field hidden in the form?
+ * @var string $hint Placeholder for the field.
+ * @var string $id DOM id of the field.
+ * @var string $label Label of the field.
+ * @var string $labelclass Classes to apply to the label.
+ * @var boolean $multiple Does this field support multiple values?
+ * @var string $name Name of the input field.
+ * @var string $onchange Onchange attribute for the field.
+ * @var string $onclick Onclick attribute for the field.
+ * @var string $pattern Pattern (Reg Ex) of value of the form field.
+ * @var boolean $readonly Is this field read only?
+ * @var boolean $repeat Allows extensions to duplicate elements.
+ * @var boolean $required Is this field required?
+ * @var integer $size Size attribute of the input.
+ * @var boolean $spellcheck Spellcheck state for the form field.
+ * @var string $validate Validation rules to apply.
+ * @var string $value Value attribute of the field.
+ * @var array $checkedOptions Options that will be set as checked.
+ * @var boolean $hasValue Has this field a value assigned?
+ * @var array $options Options available for this field.
*
- * @var string $asset The asset text
- * @var string $authorField The label text
- * @var integer $authorId The author id
- * @var string $class The class text
- * @var boolean $disabled True if field is disabled
- * @var string $folder The folder text
- * @var string $id The label text
- * @var string $link The link text
- * @var string $name The name text
- * @var string $preview The preview image relative path
- * @var integer $previewHeight The image preview height
- * @var integer $previewWidth The image preview width
- * @var string $onchange The onchange text
- * @var boolean $readonly True if field is readonly
- * @var integer $size The size text
- * @var string $value The value text
- * @var string $src The path and filename of the image
+ * @var string $preview The preview image relative path
+ * @var integer $previewHeight The image preview height
+ * @var integer $previewWidth The image preview width
+ * @var string $asset The asset text
+ * @var string $authorField The label text
+ * @var string $folder The folder text
+ * @var string $link The link text
*/
extract($displayData);
diff --git a/administrator/templates/isis/html/layouts/joomla/form/field/user.php b/administrator/templates/isis/html/layouts/joomla/form/field/user.php
index 2c609f57aa42f..bd34dce372b81 100644
--- a/administrator/templates/isis/html/layouts/joomla/form/field/user.php
+++ b/administrator/templates/isis/html/layouts/joomla/form/field/user.php
@@ -13,26 +13,51 @@
/**
* Layout variables
- * ------------------
+ * -----------------
+ * @var string $autocomplete Autocomplete attribute for the field.
+ * @var boolean $autofocus Is autofocus enabled?
+ * @var string $class Classes for the input.
+ * @var string $description Description of the field.
+ * @var boolean $disabled Is this field disabled?
+ * @var string $group Group the field belongs to. section in form XML.
+ * @var boolean $hidden Is this field hidden in the form?
+ * @var string $hint Placeholder for the field.
+ * @var string $id DOM id of the field.
+ * @var string $label Label of the field.
+ * @var string $labelclass Classes to apply to the label.
+ * @var boolean $multiple Does this field support multiple values?
+ * @var string $name Name of the input field.
+ * @var string $onchange Onchange attribute for the field.
+ * @var string $onclick Onclick attribute for the field.
+ * @var string $pattern Pattern (Reg Ex) of value of the form field.
+ * @var boolean $readonly Is this field read only?
+ * @var boolean $repeat Allows extensions to duplicate elements.
+ * @var boolean $required Is this field required?
+ * @var integer $size Size attribute of the input.
+ * @var boolean $spellcheck Spellcheck state for the form field.
+ * @var string $validate Validation rules to apply.
+ * @var string $value Value attribute of the field.
+ * @var array $checkedOptions Options that will be set as checked.
+ * @var boolean $hasValue Has this field a value assigned?
+ * @var array $options Options available for this field.
*
- * @var string $id The DOM id of the element
- * @var string $name The name of the field
- * @var boolean $required The required attribute
- * @var mixed $value The value of the field (user id)
- * @var string $class The CSS class to apply
- * @var integer $size The ize for the input element
- * @var mixed $groups The filtering groups (null means no filtering)
- * @var mixed $exclude The users to exclude from the list of users
- * @var string $onchange The script for on change event
- * @var string $userName The user name
- * @var boolean $readOnly Check for field read only attribute
+ * @var string $userName The user name
+ * @var mixed $groups The filtering groups (null means no filtering)
+ * @var mixed $exclude The users to exclude from the list of users
*/
// Set the link for the user selection page
-$link = 'index.php?option=com_users&view=users&layout=modal&tmpl=component&field={field-user-id}'
+$link = 'index.php?option=com_users&view=users&layout=modal&tmpl=component&required='
+ . ($required ? 1 : 0) . '&field={field-user-id}'
. (isset($groups) ? ('&groups=' . base64_encode(json_encode($groups))) : '')
. (isset($excluded) ? ('&excluded=' . base64_encode(json_encode($excluded))) : '');
+// Invalidate the input value if no user selected
+if (JText::_('JLIB_FORM_SELECT_USER') == htmlspecialchars($userName, ENT_COMPAT, 'UTF-8'))
+{
+ $userName = "";
+}
+
JHtml::script('jui/fielduser.min.js', false, true, false, false, true);
?>
@@ -47,13 +72,14 @@
>
/>
-
+
+ />
+
section in form XML.
+ * @var boolean $hidden Is this field hidden in the form?
+ * @var string $hint Placeholder for the field.
+ * @var string $id DOM id of the field.
+ * @var string $label Label of the field.
+ * @var string $labelclass Classes to apply to the label.
+ * @var boolean $multiple Does this field support multiple values?
+ * @var string $name Name of the input field.
+ * @var string $onchange Onchange attribute for the field.
+ * @var string $onclick Onclick attribute for the field.
+ * @var string $pattern Pattern (Reg Ex) of value of the form field.
+ * @var boolean $readonly Is this field read only?
+ * @var boolean $repeat Allows extensions to duplicate elements.
+ * @var boolean $required Is this field required?
+ * @var integer $size Size attribute of the input.
+ * @var boolean $spellcheck Spellcheck state for the form field.
+ * @var string $validate Validation rules to apply.
+ * @var string $value Value attribute of the field.
+ * @var array $checkedOptions Options that will be set as checked.
+ * @var boolean $hasValue Has this field a value assigned?
+ * @var array $options Options available for this field.
*
- * @var string $asset The asset text
- * @var string $authorField The label text
- * @var integer $authorId The author id
- * @var string $class The class text
- * @var boolean $disabled True if field is disabled
- * @var string $folder The folder text
- * @var string $id The label text
- * @var string $link The link text
- * @var string $name The name text
- * @var string $preview The preview image relative path
- * @var integer $previewHeight The image preview height
- * @var integer $previewWidth The image preview width
- * @var string $onchange The onchange text
- * @var boolean $readonly True if field is readonly
- * @var integer $size The size text
- * @var string $value The value text
+ * @var string $preview The preview image relative path
+ * @var integer $previewHeight The image preview height
+ * @var integer $previewWidth The image preview width
+ * @var string $asset The asset text
+ * @var string $authorField The label text
+ * @var string $folder The folder text
+ * @var string $link The link text
*/
extract($displayData);
diff --git a/layouts/joomla/form/field/user.php b/layouts/joomla/form/field/user.php
index 2b63586c2dcab..0905e6651b2de 100644
--- a/layouts/joomla/form/field/user.php
+++ b/layouts/joomla/form/field/user.php
@@ -13,25 +13,50 @@
/**
* Layout variables
- * ------------------
+ * -----------------
+ * @var string $autocomplete Autocomplete attribute for the field.
+ * @var boolean $autofocus Is autofocus enabled?
+ * @var string $class Classes for the input.
+ * @var string $description Description of the field.
+ * @var boolean $disabled Is this field disabled?
+ * @var string $group Group the field belongs to. section in form XML.
+ * @var boolean $hidden Is this field hidden in the form?
+ * @var string $hint Placeholder for the field.
+ * @var string $id DOM id of the field.
+ * @var string $label Label of the field.
+ * @var string $labelclass Classes to apply to the label.
+ * @var boolean $multiple Does this field support multiple values?
+ * @var string $name Name of the input field.
+ * @var string $onchange Onchange attribute for the field.
+ * @var string $onclick Onclick attribute for the field.
+ * @var string $pattern Pattern (Reg Ex) of value of the form field.
+ * @var boolean $readonly Is this field read only?
+ * @var boolean $repeat Allows extensions to duplicate elements.
+ * @var boolean $required Is this field required?
+ * @var integer $size Size attribute of the input.
+ * @var boolean $spellcheck Spellcheck state for the form field.
+ * @var string $validate Validation rules to apply.
+ * @var string $value Value attribute of the field.
+ * @var array $checkedOptions Options that will be set as checked.
+ * @var boolean $hasValue Has this field a value assigned?
+ * @var array $options Options available for this field.
*
- * @var string $id The DOM id of the element
- * @var string $name The name of the field
- * @var boolean $required The required attribute
- * @var mixed $value The value of the field (user id)
- * @var string $class The CSS class to apply
- * @var integer $size The ize for the input element
- * @var mixed $groups The filtering groups (null means no filtering)
- * @var mixed $exclude The users to exclude from the list of users
- * @var string $onchange The script for on change event
- * @var string $userName The user name
- * @var boolean $readOnly Check for field read only attribute
+ * @var string $userName The user name
+ * @var mixed $groups The filtering groups (null means no filtering)
+ * @var mixed $exclude The users to exclude from the list of users
*/
-$link = 'index.php?option=com_users&view=users&layout=modal&tmpl=component&field=' . $id
+$link = 'index.php?option=com_users&view=users&layout=modal&tmpl=component&required='
+ . ($required ? 1 : 0) . '&field={field-user-id}'
. (isset($groups) ? ('&groups=' . base64_encode(json_encode($groups))) : '')
. (isset($excluded) ? ('&excluded=' . base64_encode(json_encode($excluded))) : '');
+// Invalidate the input value if no user selected
+if (JText::_('JLIB_FORM_SELECT_USER') == htmlspecialchars($userName, ENT_COMPAT, 'UTF-8'))
+{
+ $userName = "";
+}
+
// Load the modal behavior script.
JHtml::_('behavior.modal', 'a.modal_' . $id);
@@ -40,11 +65,13 @@