jfquestiaux
Well-Known Member
I am using the usergroup element in a form but it seems to be a bug:
When you create a new record, check only one group, it shows correctly in the list but if you try to edit the form, you have the following warning (about a whole page of it):
Warning: in_array() expects parameter 2 to be array, string given in /home/livingjfq/public_html/j3/libraries/joomla/html/access.php on line 167
and the previously checked group appears unchecked on the form.
However, if you check two (or I suppose more) groups, everything works fine (in the list and on edit).
The reason is that when you have a single group, the element saves the group ID under : 2 (for instance) while it should save it under JSON format : ["2"]
For multiple groups, it saves correctly : ["2","3"]
I looked at the element but can't see where it does any saving.
Tested on J! 3.1.1 and latest GitHub.
When you create a new record, check only one group, it shows correctly in the list but if you try to edit the form, you have the following warning (about a whole page of it):
Warning: in_array() expects parameter 2 to be array, string given in /home/livingjfq/public_html/j3/libraries/joomla/html/access.php on line 167
and the previously checked group appears unchecked on the form.
However, if you check two (or I suppose more) groups, everything works fine (in the list and on edit).
The reason is that when you have a single group, the element saves the group ID under : 2 (for instance) while it should save it under JSON format : ["2"]
For multiple groups, it saves correctly : ["2","3"]
I looked at the element but can't see where it does any saving.
Tested on J! 3.1.1 and latest GitHub.