Problem/Motivation
The workflow participants tab does not show up for users who viewed a node immediately prior to being added as a workflow participant. Steps to recreate:
Create a node as user A, who has permission to manage workflow participants for their own content.
Login and view the node as user B, who does not have any permission to manage workflow participants in any capacity.
Logout as user B, and login as User A. Add user B as an editor, and save.
Logout as user A, and visit the node as User B.
The workflow participants tab does not show up, but it should.
Proposed resolution
Provide a definition for getCacheTagsToInvalidate() in the WorkflowParticipants entity, and use the cache tags from the moderated entity as the tags to invalidate.
Remaining tasks
Write a patch, review.
User interface changes
None.
API changes
None.
Data model changes
None.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | 2876198-04-TEST-ONLY.patch | 1.39 KB | jhedstrom |
Comments
Comment #2
jhedstromThat's odd--the entity does implement
getCacheTags():Comment #3
mroycroft commentedThe proposed fix is to override this function from
Entity.phpThe idea is that inside the workflow participants entity, to provide the cache tags to invalidate for the workflow participants entity, and the moderated entity in which the workflow participants are attached to. This this data is available on from the
getCacheTags()method, it could be as simple as calling that function inside ofgetCacheTagsToInvalidate()Comment #4
jhedstromI wasn't able to reproduce this. Here is a test that attempts to mimic the steps outlined above, but it is passing. (It's possible this has been fixed elsewhere in the 2.x version).
Comment #5
jhedstromPostponing for clarification for the time being.
Comment #6
mroycroft commentedHmm, can't apply patch for the 8.x-1.x version, which is where the issue was originally reported. Tester doesn't allow an appropriate Drupal version to be picked for 8.x-1.x testing. I agree, it does appear to not be an issue in the 8.x-2.x version.
If 8.x-1.x development is halted, this should be probably closed as won't fix. For now, switching the version back to 8.x-1.x.
Comment #7
mroycroft commentedI did test this on the 8.x-1.x version and the test does fail at
$this->assertSession()->linkExists(t('Workflow participants'));. So it's fixed in 8.2 branch but broken in 8.1.This might be a handy test to keep, in case there is an issue with cache tags in the future.
Comment #9
jhedstromGood idea to keep the test! Committed to 2.x. Thanks!