Closed (fixed)
Project:
Workbench Access
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
3 Apr 2013 at 03:08 UTC
Updated:
22 Sep 2015 at 23:44 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
heydemo commentedComment #2
agentrickardI don't understand the problem you describe. Please provide a bullet list of steps to replicate, including URL paths.
Comment #3
agentrickardThanks for nothing.
Comment #4
agentrickardI did just run into a case where using the Editor form did not work properly if the user was already assigned by role access. I wonder if these are the same issue.
Comment #5
agentrickardHere's a patch that seems to fix the real issue.
Comment #7
agentrickard#5: 1959590-wa-user-save.patch queued for re-testing.
Comment #9
agentrickardFixed that test bug.
Comment #11
agentrickard#9: 1959590-wa-user-save.patch queued for re-testing.
Comment #13
agentrickardWrong damn version.
Comment #14
agentrickard#9: 1959590-wa-user-save.patch queued for re-testing.
Comment #15
coolestdude1 commentedI was having this issue in a production site today and noticed a very small change that can be done to improve the loading of the data or at least make this page more robust but on line number 357 of file workbench_access.admin.inc you might want to do this instead
$account = user_load($account->uid, TRUE);This just ensures the data in user load is the freshest available data. Its not that much of a performance hit because the page is rarely accessed (at least on my site).
My team and I were able to track it down to a database cache issue which was cleared by flushing all caches. Hope that helps
Comment #16
agentrickardBut does the patch as written actually fix the problem?
Comment #17
kholloway commentedNeither the Patch provided or comment #15 solved this issue for me which I am also having. I noticed that this goes beyond the form but effects any user_load of a user. The database stored sections appear perfect, they just aren't effecting user_load instances of that user's access which leads me to believe it's a caching issue.
Comment #18
kholloway commentedI think I resolved the issue. Essentially the issue is with the workbench_access_user_load_data function which handles adding on the sections the user has permissions to. The function was running a diff between sections the user has access to (after loading that information from the database) and all sections that exist. That diff was then used to add sections to the user variable which would become sections the user DOESN'T have access to and then was then adding them to the current user variable.
So essentially they would end up looking like they have access to only the sections they don't actually have access to. Fix was seriously one line of code being changed. I am including the patch.
Comment #20
agentrickardComment #21
sgdev commentedPlease see this related issue: https://www.drupal.org/node/2546038
The recent 7.x-1.3 release creates a bug due to this patch. Thanks.
Comment #22
redndahead commentedThe patch here caused anyone who uses roles for the permissions to stop working. The patch here reverts this patch which fixes our issue of no workbench sections being available when creating new content. #2547039: Not applying access by user and role settings correctly
Comment #23
redndahead commentedDuplicate
Comment #24
gabriel.achille commentedsame same: this fix creates the bug #2546038: No options in the Workbench Access control field for me. Reverting it fix the bug.
I struggle to understand/reproduce the problem described in this issue, it seems that different problems have been described. Can someone provide a bullet list of steps to replicate.
But definitely the diagnostic written in comment-18 is wrong:
Hence the patch may fix a bug but it creates another one. The patch reverse an if-condition which was right to me: it was adding to the user section a role-based section only if it wasn't already present because it has already been granted as a user-based section. So role-based section are ignored.
Comment #25
Yerwol commentedI found this bug after a massive breadcrumb trail of git commits and debugging, and am having the issue where if someone's assigned access via a role, it wasn't working, but worked fine if they were assigned as an editor.
Reverting the change under #18 fixed it for me.
Otherwise if you read through the code, it's saying:
1) load the accessible sections by user id
2) foreach section, save it to an array
3) load the accessible sections by users roles
4) foreach section, *if the user already has access to this based on their user id*, give them the same access again.
which just sounds wrong when you consider it through the common sense method!
Inverting the if makes much more sense.
Comment #26
gabriel.achille commentedBefore this patch the code was saying:
...
4) foreach section, *if the user
alreadyhas NOT access to this based on their user id*, give them thesameaccessagain.And it was making more sense to me too.
@kholloway, can you describe what is the other problem that this patch is actually solving?