?
avatar jaworskimatt
jaworskimatt
19 Nov 2014

Steps to reproduce the issue

This bug is not easy to reproduce, because it seems to be random at first. Best way to reproduce is have a user assigned to all the ACL grops in Joomla, and then open a few tabs in rapid succession with a subpage that performs a save on the user object.

Expected result

No #__user_usergroup_map records get lost

Actual result

User gets unsassigned from groups. If JTable::store() happens on the same user concurrently, it will eventually lead to loss of #__user_usergroup_map rows for that user. Because JTable::store() deletes everything from #__user_usergroup_map and then re-adds one by one, if that process happens multiple times in parallel for the same user, the inserts and deletes get mixed up.

System information (as much as possible)

Joomla 3.3.3

Additional comments

// TODO: This is a dumb way to handle the groups.

Among JomSocial developers issues caused by this implementation are known as "the bug from hell" that lead to users randomly losing priviledges on a dozen or so websites, it took us qite a while to nail it.

I wrote a fix for this, that instead of performing "delete and re-insert one by one", grabs the records from the database, loops through them, decides which should stay and which should go based on $this->groups and then adds new ones (if any) from $this->groups

http://pastebin.com/NJcmnaCT

Votes

# of Users Experiencing Issue
5/6
Average Importance Score
5.00

avatar jaworskimatt jaworskimatt - open - 19 Nov 2014
avatar Bakual
Bakual - comment - 19 Nov 2014

Can you create a Pull Request since you already propose a solution? Then it can be tested.

avatar zero-24
zero-24 - comment - 19 Nov 2014

@jaworskimatt if you need help for the pull request please have a look into this doc page: http://docs.joomla.org/Using_the_Github_UI_to_Make_Pull_Requests

This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/5138.

avatar jaworskimatt
jaworskimatt - comment - 20 Nov 2014

@Bakual @zero-24 pull request created

This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/5138.

avatar Bakual
Bakual - comment - 20 Nov 2014

Closing issue since we have a PR: #5144

avatar Bakual Bakual - close - 20 Nov 2014
avatar zero-24 zero-24 - close - 20 Nov 2014
avatar Bakual Bakual - change - 20 Nov 2014
Status New Closed
Closed_Date 0000-00-00 00:00:00 2014-11-20 07:28:07
avatar zero-24 zero-24 - change - 7 Jul 2015
Labels Added: ?

Add a Comment

Login with GitHub to post a comment