Good afternoon!
I had something pop up as I was attempted to create a feature out of a workflow on my local environment to re-create it on a dev environment.
The workflow I created on my local environment had a series of workflow states ( SID - state name: 2- send to editorial, 3- needs work, 4- published, 5-unpublished, 6- draft).
The order of the workflow states was as follows:
Draft (sid 6)
Send to Editorial (sid 2)
Needs Work (sid 3)
Published (sid 4)
Unpublished (sid 5)
The reason why "Draft" has an SID of 6 but positioned first in the order of workflow states is because it was decided (after the other 5 states had been created) to add it and make it the first available workflow state. I also created a set of rules for these workflow states and saved that as a feature as well.
When I installed the feature on my dev environment, which had no previous installation of workflow, the feature would display as "overridden" and the rules I installed would not fire. On closer inspection of the override diff, it seems like the SID's were being re-written to match their weight. Changing the SIDs incidentally broke the rules I wrote for it as the rules point to the SID not the state name. Reverting the feature would not work to set the SID's back to the feature's defaults. I tried creating a new workflow with the SID's matching their weights and that seemed to work fine, but it seems like if the SID's don't match the workflow state weights there will be overrides.
Attached is a screenshot of the overrides.
| Comment | File | Size | Author |
|---|---|---|---|
| Features-Gateway-Connect 2014-05-12 13-33-45.png | 351.9 KB | poindexterous |
Comments
Comment #1
johnvThanks for your detailed report.
I don't think I have a solution for your current problem, but we are working on a solution.
- Was your feature created in an older version? They are not compatible.
- We are working on #2196247: [EXPORTING] Add machine names to workflow states, to avoid the problem you are sescribing: overriden States, and referring to them with numbers versus names.
- I always see the Workflow features as 'overridden', but I was not aware of the 'Review Overrides option.'
Comment #2
poindexterous commentedHi Johnv,
Thanks again for the quick response and for directing me to the other issue, I didn't realize that my issue may have been related to #2196247- I will be following that one as well.
To answer your question about the version I'm using, the feature was created in v 7.x-2.3.
I think the "review overrides" tab appears in features if you have the Diff module installed, but I'm not 100% certain if there is another module installed on my environment that makes it available since other members of the team I work on have had a hand in configuring our site.
Comment #3
johnvI created a META-issue for this.
Comment #4
johnvI tried to resolve this. But it is too complicated. D8 will have named entites and UUID-support by default.
I suppose it will take D8 to resolve this ...
Comment #5
johnvAdded [EXPORT] tag to title.
Comment #6
johnvComment #7
kaareI'm constantly bumping into this problem. I've created a feature with content types and a workflow field in some of them. This is primary used for installation before migrating D6 content to D7, but as soon as the feature is installed it appears modified, and reverting it causes the workflows and state IDs to be rewritten.
So this is a difficult problem to solve. But is there a way to organize ones features so that the workflow field is installed, but otherwise not affected by further changes to the feature containing other fields and content types? A clever trick to work around this issue?
Comment #8
kenorb commentedI've the problem, when my feature is all the time Overridden, despite reverting it.
E.g. wid_original is different (3 vs 5) and transition ids, so how this suppose to be reverted, if wid_original is now different?
Not sure if it's the same issue, or different.
Comment #9
guypaddock commentedSee #7 in #2484297: Features import / revert broken in 2.5+: Features import / revert broken in 2.5+ for my take at a patch.
Comment #10
johnvMarking this as active again, although it will need a volunteer to solve this.
In D8, this is not relevant, since workflows are config-entities, with machine_names.
Comment #11
johnv@kaare,
If you create a feature with a workflow field, you can Uncheck the Workflow as part of the feature. This will remain if you 'recreate' the feature.
Now you can have 1 feature with the workflow, and other features with the workflow_field.
However, the workflow_field still has a numeric state id in the export, not the machine_name. See #2152435: [EXPORTING] Export of Workflow Field using machine_name, not $wid
Comment #12
kaareNice progress here. Like it a lot!
Comment #13
johnvThanks. I am preparing a version 2.6.
I guess there will be no more progress until that version, but it will give a new starting point for the crowd.
Comment #14
johnvNew features for D7 are not processed anymore, (unless a patch is provided)