Closed (outdated)
Project:
Workflow
Version:
7.x-1.x-dev
Component:
Workflow Access: Code
Priority:
Major
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
30 Mar 2012 at 12:58 UTC
Updated:
29 Oct 2016 at 20:34 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
Bastlynn commentedAt the moment that isn't an exportable feature, once we get a few more things backported from 7.x to 6 - I'll pick this up as the next thing to export. (Unless someone else works up a patch first, in which case it'll go in sooner. )
Comment #2
jpoesen commentedI've added tentative Features support for workflow_access. Appears to be working well in a current staging->production environment we set up for a client.
Note: This is my first Features integration code.
Comments always welcome.
Comment #3
flyingkiki commentedUpdate patch in comment #2 for below purpose:
The exported workflow_access configuration references roles by rid which leads to wrong roles configuration when imported the features
Modification: use role_name to configure the mapping.
Comment #4
Volx commentedI can confirm, that the patch works as intended, thanks!
One more thing I would like to see for better usability is that when adding a workflow to a feature and this workflow uses workflow_access, then the workflow_access feature item should be added automatically.
Comment #5
Volx commentedUnfortunately I have to revoke my confirmation, the access rules for the author are missing. That's because the sql select to get all access rules joins the role table and the author is not a role, so we need special handling for the author. I changed the select to use a left join so it also picks up entries that do not have a corresponding role, to be safe I added a check if the rid is either a valid role id or -1 (i.e. the author "role"). Since the select will not return a role name for the author, WORKFLOW_FEATURES_AUTHOR_NAME is used when rid is null. On rebuild WORKFLOW_FEATURES_AUTHOR_NAME is replaced with -1.
As far as I can tell (it's getting pretty late :) ) this is working for me now.
Comment #6
bladeduUsing the patch #5 I get a notice error:
apart from that, it works.
Comment #7
bladeduThis patch (which is a fix of patch #5) should fix the problem.
Comment #8
nancydruThere is no workflow_access/workflow_access.features.inc in my current code.
Comment #9
fgmThat file is introduced by the patch itself. The logic inherent in using that constant for its string value does not seem to be correct, though.
There is a deeper problem: this export uses the workflow state
sid, but there is no guarantee that they will be correct: indeed, once one deletes a given workflow or even just one of its states, this export cannot restore the WF access because the sids used are no longer available. WF access export needs to use the statestateinstead of itssid.Comment #10
fgmWorking on redoing it with names instead of ids. Will probably involve a new dependency on EntityAPI and a schema change.
Comment #11
nancydruThanks, Frederic.
Comment #12
fgmSeems to work, but needs tests and review.
It could also probably be made rather faster, but the workflow API is showing its age: it really needs to be overhauled on top of Entity API, but that will be for a major version, I guess.
Comment #13
fgmRerolled against latest 7.x-1.x HEAD: previous version no longer applied.
Comment #14
nancydruI'd like to get my UI changes committed before I apply this. But many thanks for the patch.
Comment #15
fgmJust ask if you need it to be rerolled.
Comment #16
fgmChanging component.
Comment #17
fgmAnother patch (0002.....) to apply only once the previous one has been merged: workflow_access instances depend on their respective workflow.
And yet another to apply on top of the previous two (0003...): workflow access needs the roles used in the export to exist.
Comment #18
fgmWhoop, looks like the 0002... patch didn't make it.
Comment #19
nancydruCommitted with attribution
Comment #20
nancydruIncluded in 7.x-1.1-rc1
Comment #21
supercone commentedPatch for this issue, is it already part of the recent version both full and dev releases?
Because when I exported the workflow, I didn't see any indication of workflow 'access' being part of the export code.
I had manually update the workflow 'access' settings again once I did workflow export.
Comment #22
supercone commentedComment #23
johnv@supercone, this is a very old issue. Version 7.x-1.x is not supported. All new features are in 7.x--2.x