[BUG]: usergroup field doesn't work when compiling towards Joomla 4 (works in J3) #1100
Labels
No Milestone
No project
No Assignees
4 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: joomla/Component-Builder#1100
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What Happened?
I added a field of type usergroup to the demo project look view. When I compile towards Joomla 3, I can see and select the usergroups as expected. However, when I compile towards Joomla 4, the field is just blank.
Steps to reproduce the Bug
Create a field of type usergroup and add it to a view, then compile towards Joomla 4.
Which Joomla version are you compiling in?
3.10.12
Which PHP version are you compiling in?
8.1.27
Which Joomla versions are you targeting?
4
Which PHP version are you targeting?
8.1
Which Web server is JCB running on?
Apache 2.4
Which Relational Database is JCB running on?
MariaDB 10.4
Which OS is JCB running on?
Ubuntu 20.4
Which JCB version are you using?
3.2.0 stable
Which Joomla version is JCB installed on?
Joomla 3
Where in JCB did this issue occur?
Joomla Component(admin_view)
On which browsers did you encounter the issue?
Safari
Additional Comments
No response
I had the same problem.
After some digging, I find out that this problem is resolvable without coding.
Joomla website: Since Joomla 3.2 use usergrouplist instead.
General steps:
@Llewellyn, I think this problem could be resolved by adding this insert query to
#__componentbuilder_fieldtype
multiple insert query ininstall.mysql.utf8.sql
and also adding it to3.2.0-beta.sql
.I wanted to send a Pull Request to fix this problem. May I? Could you give me Pull Request permission please?
Or you could fix it yourself, that's totally cool too 😀
Since field_types are all DB maintained we currently do not update existing Installs. We are working on an option to also maintain this the way we do powers. So you have
power => [init]
andpower => [reset]
in the the Powers list view, we are planning to add this to the field_types as well but this is not yet finished.I can fix the
Usergrouplist
so that it will be correct with new JCB installs, but adding an update script to the install is not the direction we would like to take to resolve this going forward.And I done not want these kind of links in this area of JCB:
http:\\\/\\\/joomlacode.org\\\/gf\\\/project\\\/joomla\\\/tracker\\\/?action=TrackerItemEdit&tracker_item_id=28450
I'm having an problem with the usergrouplist field in version 4.0.3-alpha2. The field works and saves correctly but when using a usergrouplist field and showing it in a admin view list it crashes
The culprit seems to be this line in /web/administrator/components/COMPONENTNAME/src/Model
Changing the line to this fixes the error:
I can't find a spot to override this line (which is fair) so for now i just have to change the files and make them readonly so updates don't change them back.
There is a catch for the usergroup and it might be because we now have a different name... that it ends up instead triggered the generic code. Since it should validate true for usergroup field type on line 20680. So if you change the 20680 lines to:
This should resolve the issue... I will add the update to the next stable release, if you can confirm its fixed. There might be more areas... I will search the compiler and ensure to catch all these tweaks for the usergroup field type.
Yes that seems to fix the issue! A final thing i see is that i have selected the usergrouplist field to sortable,searchable and filter.
But the filtering does not appear, and sorting doesn't work either.
Searching in the search field gives an error due to this:
a.usergroup does not exists, as it should be a.fieldname where fieldname is set in the field defenition
Not the biggest issue in the world, just means you can't have the search box ticked for usergrouplist fields.
Yes a found a few more places this needs updating, I am nearly ready to push out another alpha release, with these fixes.