I have 2 workflow fields on a content type. It's sort of a to-do list type use case.

One field is basically a "complete" / "open" status. "complete" items shouldn't be editable. This works fine.

The other indicates the status of the 'list' the items belong to. This relationship is established with an entityreference field and when the parent 'list' has it's workflow status updated, that status is cascaded to all child items with a hook_entity_update call that performs workflow_execute_transition() on all the referencing items. This part also works fine. The status for child items correctly mirrors the reference parent.

Then, if the parent list has a workflow status of "cancelled" nothing should be editable-- including children with a status of 'open'. so basically, the list status should trump the completion status in all cases. This is not happening. It appears as if the list status is having no effect.

If it's because the workflow machine name of the per item workflow occurs before the list workflow or because the sid of the per item workflow is lower than the parent sid, then it could be solved by creating the workflows in the right order or naming them appropriately.

Or it might be that anything other than the first workflow is ignored. Any info about what's supposed to happen would be great!

I'm thinking this should be solvable with a priority setting on individual workflow fields, but before working up a patch I wanted to check to see if this makes sense and try to understand how this is currently handled.

From what I see, it should be as simple as adding a per field priority setting to workflow field settings, and altering workflow_access_node_access_records() to use that priority instead of the generic workflow_access_priority variable.

Does that make sense? And would you consider a patch?

Obviously, I can just write a custom nodeaccess handler and not use workflow_access, but I'd much rather contribute it if you think it would be useful.

Thanks!

And thanks for all the work on the 7.x versions of the module-- I'm upgrade a d6 site, and the improvements are brilliant!

Comments

WorldFallz created an issue. See original summary.

johnv’s picture

Title: workflow access with 2 workflow fields on the same content » workflow access with multiple workflow fields on the same content

Many functions work with 'multiple workflows per content type'. However, the content access is not yet one of them. This ope issue describes the situation. It is both for D8 and D7: #2446811: Permissions: Add support for multiple workflow fields in workflow_access

johnv’s picture

johnv’s picture

Status: Active » Closed (duplicate)