Closed (fixed)
Project:
Access unpublished
Version:
8.x-1.x-dev
Component:
User interface
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
19 Mar 2017 at 16:53 UTC
Updated:
5 Apr 2018 at 21:14 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
jchand commentedComment #3
findleys commentedComment #4
chr.fritschI am not sure if the issue belongs to the access_unpublish module. Can someone please clarify that?
Comment #5
vivify commented1. Create and save article node without publishing.
2. Generate a link to the unpublished node.
3. Visit page with link and everything is fine.
4. Publish the article node.
5. Go back and edit that same article node and create a draft revision.
6. Visit link to the node again. Link shows previous published revision and not new draft revision.
Comment #6
findleys commentedComment #7
chr.fritschAh ok, now i get it.
So here is a patch to support cores content_moderation module.
Comment #8
chr.fritschComment #9
chr.fritschRe-roll
Comment #10
vegantriathleteI must say that I'm very happy to see work on this! It will be a great new feature to add to the module. I'll have a look at the patch and see if I've got anything to contribute.
Comment #11
vegantriathleteIt appears to me that your patch is designed to work with Drupal's content moderation as opposed to Workbench Moderation. I can understand that it's easier to do that. However, this issue specifically asks about getting this module to work with Workbench Moderation.
Comment #12
vegantriathleteI know that, per the project page for Workbench Moderation
Unfortunately, I don't believe there is any upgrade path from Workbench Moderation to Content Moderation at this point.
Comment #13
vegantriathleteSo the question is, what is the best path forward? It's great to get this module to work with Content Moderation.
Comment #14
vegantriathleteNote: As of 8.5.x Content Moderation is no longer marked as experimental.
Comment #15
chr.fritschAs you noted, workbench_moderation was replaced by content_moderation and it's stable since D 8.5. I would like to avoid offering support for workbench_moderation since it would make the code much more complex.
FYI: The upgrade path workbench_moderation -> content_moderation can be found here: https://www.drupal.org/project/wbm2cm
Comment #16
vegantriathletePerfect! Thanks for the link to the migration path. I'm comfortable with the call to not provide support for Workbench Moderation.
Comment #17
chr.fritschAdded some tests
Comment #18
alexpottDoing this doesn't play nice with other overrides. Ideally we'd inform everyone this is a really bad way to change functionality. We should decorate the service instead. That way if something else decorates there is a chance that we all play nice together.
I tried to implement the change as just another access check but since \Drupal\Core\Access\AccessManager::check() uses andIf() this is not possible. This kind of surprises me but anyhow patch attached does the decoration.
Not used - I guess a c&p. Removed.
Added more time here because it wasn't long enough for a decent debug session.
Comment #20
chr.fritschI tested your patch. Everything worked nicely and your solution is much more future proof.
Thank you.
Committed and pushed.