Create a form field:
<field
name="myfield"
type="usergroup"
label="User Group">
<option value="">No Group</option>
</field>
A dropdown with 'No Group' as the initially selected value.
A dropdown with 'Show All Groups' as the initially selected value
JFormFieldUsergroup::getInput() returns with:
return JHtml::_('access.usergroup', $this->name, $this->value, $attr, $options, $this->id);
But the class is defined as:
JHtmlAccess::usergroup($name, $selected, $attribs = '', $allowAll = true)
Note that $options is being passed to $allowAll. On a slightly related note, the call is passing a fifth argument the method doesn't accept at all.
In addition, there is another form field JFormFieldUsergrouplist which does work as expected. It would seem both form fields are intended to serve the same function and so are duplicates. JFormFieldUsergroup should either be fixed or deprecated.
I have a plugin in which I want to have a user group optionally selected. Since it isn't required, JFormFieldUsergroup won't work. JFormFieldUsergrouplist does exactly what I need.
That's just a typo. Of course the xml as posted wouldn't work. But since I can't go back and edit the original report, hopefully, testers will be smart enough to recognize this.
You may blame the J!Tracker Application for transmitting this comment.
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2014-04-09 10:38:42 |
Labels |
Added:
?
|
Without testing it.. Have you noticed that in your field defininition you are opening an {option} (singular) and closing an {options} (plural) ?