?
avatar billtomczak
billtomczak
8 Apr 2014

Steps to reproduce the issue

Create a form field:

<field
   name="myfield"
   type="usergroup"
   label="User Group">
   <option value="">No Group</option>
</field>

Expected result

A dropdown with 'No Group' as the initially selected value.

Actual result

A dropdown with 'Show All Groups' as the initially selected value

System information (as much as possible)

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.

Additional comments

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.

Votes

# of Users Experiencing Issue
1/1
Average Importance Score
3.00

avatar btomczak btomczak - open - 8 Apr 2014
avatar btomczak btomczak - change - 8 Apr 2014
The description was changed
avatar phproberto
phproberto - comment - 8 Apr 2014

Without testing it.. Have you noticed that in your field defininition you are opening an {option} (singular) and closing an {options} (plural) ?

avatar btomczak
btomczak - comment - 8 Apr 2014

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.

avatar phproberto phproberto - reference | - 8 Apr 14
avatar phproberto phproberto - reference | - 8 Apr 14
avatar phproberto
phproberto - comment - 8 Apr 2014

I've sent a patch to deprecate UserGroup as it effectively doesn't support parent options and all ocurrences work with UserGroupList.

See: #3421

Thanks for reporting the issue @btomczak !

avatar zero-24 zero-24 - close - 9 Apr 2014
avatar brianteeman
brianteeman - comment - 9 Apr 2014

Closing this in favour of #3421

avatar brianteeman brianteeman - change - 9 Apr 2014
Status New Closed
Closed_Date 0000-00-00 00:00:00 2014-04-09 10:38:42
avatar brianteeman brianteeman - close - 9 Apr 2014
avatar zero-24 zero-24 - change - 7 Jul 2015
Labels Added: ?

Add a Comment

Login with GitHub to post a comment