Enabling the "Content Moderation" module breaks the bulk operations at /admin/content for all content types, even ones that don't have Content Moderation enabled for them specifically.
This makes some sense when Content Moderation is enabled, because it fundamentally changes the publishing workflow for these node types. For the others, to my eye it is just an overzealous permissions restriction.
Those publish/unpublish operation should probably be adapted to handle this situation, since they are in core, as a part of pulling content moderation into core. This issue, however, is only for the inappropriate permissions blocking for content types that are not using Content Moderation.
Related issue: https://www.drupal.org/node/2804105
Comment | File | Size | Author |
---|---|---|---|
#41 | Screen Shot 2017-10-18 at 9.09.06 AM.png | 63.99 KB | imperator_99 |
#39 | unable_to_VBO_publish-2825579-8.patch | 3.91 KB | ghuygens |
#25 | 2825579-25.patch | 7.8 KB | timmillwood |
#25 | interdiff.txt | 4.66 KB | timmillwood |
#22 | Screen Shot 2016-12-26 at 7.33.17 PM.png | 56.45 KB | Sam152 |
Comments
Comment #2
gcbComment #3
Sam152 CreditAttribution: Sam152 commentedComment #4
alexpott@Sam152 yep this needs tests so needs work...
Nice find @gcb
Comment #5
Sam152 CreditAttribution: Sam152 commentedI don't get the body of the access check to be honest, it reads:
Why would access to the plugin be denied if the entity was moderated? The whole point of it is to provide a nice message to the user as to why their entity can't be published/unpublished as a bulk action.
Comment #6
Sam152 CreditAttribution: Sam152 commentedBefore and after:
I think the approach of removing the access constraint based on if the entity is moderated or not is the right move, happy to be proven wrong. Attached is a fix based on that approach and a test.
Comment #7
Sam152 CreditAttribution: Sam152 commentedI guess the test should also make sure bundles that aren't moderated behave normally and that the action itself transitions the published state correctly for each scenario.
Comment #10
timmillwoodJust been testing out this patch it's not very good UX. It doesn't seem clear what's going on.
I think this patch makes things better than HEAD, but I think it could be better again. Maybe list which entities could not be published, and which could not be unpublished. Then explain how to publish / unpublish them.
Maybe we need actions for moderation states so you can bulk publish / unpublish entities?
Comment #11
gcbI would suggest that the bulk actions be updated to handle content-moderation enabled entities: that's the most intuitive behavior. As I suggested in original post, I think that is probably a different ticket, however. This ticket is about a specific, confirmable bug. The overall UX and behavior needs some discussion: I think taking that elsewhere makes sense so we can get this bug squished.
Comment #12
Sam152 CreditAttribution: Sam152 commented#2753157: Expose workflow states and status as selects in /content has a design for what this interface might look like. I don't mind blocking/postponing behind that, but as #11 points out this just fixes a bug with existing behaviour.
Comment #13
Sam152 CreditAttribution: Sam152 commentedHit this again personally. I think we should fix the bug and address the UX issues in a follow up, given this breaks publish/unpublish for ALL node types regardless of CM being enabled. UX changes are likely to be way bigger in scope and can be derailed easier than a simple bugfix.
Comment #14
timmillwoodI think it still might be good to add a bit more context to the Drupal set message. Was it one entity? or more? how many was it? which ones? which bundles / content types?
Could we say "All Article Nodes were skipped as they are under moderation and may not be directly published or unpublished."? Or "Three Article Nodes were skipped as they are under moderation and may not be directly published or unpublished."?
Even replacing entities with Nodes would help.
Comment #15
Sam152 CreditAttribution: Sam152 commentedMentioning the bundle sounds like a really good idea.
Comment #16
timmillwoodComment #17
timmillwoodComment #18
Sam152 CreditAttribution: Sam152 at PreviousNext commentedComment #19
timmillwoodComment #20
timmillwoodQuite a big rewrite, changing this to hook into the access handler and adding the bundle label in the warning.
Comment #22
Sam152 CreditAttribution: Sam152 at PreviousNext commentedI ran the tests and these are the messages that show up using the access approach, although I do like the bundle being in the message.
Comment #23
Sam152 CreditAttribution: Sam152 at PreviousNext commentedThe fail is a bug that must have been introduced since #7. Opened #2839371: Programatically creating a published entity doesn't result in a published entity. for it.
Comment #24
timmillwoodJust thinking about this, we shouldn't use the term "nodes" here, we should use 'label_singular' or 'label_plural'.
Comment #25
timmillwoodHere's a patch that should now pass tests.
I think the "no access" message shown in #22 is better than the "published" message shown in #6, shown when nothing was published.
Comment #27
timmillwoodYay, finally passing.
Comment #28
Sam152 CreditAttribution: Sam152 at PreviousNext commentedComment #30
timmillwoodComment #31
alexpottCommitted 4739b5c and pushed to 8.3.x. Thanks!
Fixed on commit.
Comment #32
timmillwoodIs it worth backporting this to 8.2.x?
Comment #35
podarokIs it possible to backport the code to 8.2.x branch?
Comment #36
timmillwood@podarok - You're welcome to port it back, but a lot has changed between 8.2 and 8.3 for Content Moderation, so didn't seem worth it.
Comment #37
wesleymusgrove CreditAttribution: wesleymusgrove commented@timmillwood are any of these patches applicable to 8.2.x? I ran into this issue of not being able to unpublish nodes after sending them all the way up the moderation chain (draft, review, editing, approved, published, archived) only to find out that I can't unpublish a node if I realize some mistakes that didn't get caught during the review phase.
Is the Workflow contrib more stable than Core Content Moderation at this point for 8.2.x?
Comment #38
timmillwood@wesleymusgrove - The patch should work fine in 8.2 apart from the test IIRC.
There are experimental modules, so there is no upgrade path, and we may change things. So it may be safer to use Workbench Moderation, however we've fixed many issues in Workbench Moderation when porting to Content Moderation.
Comment #39
ghuygens CreditAttribution: ghuygens as a volunteer commentedI applied the patch on 8.2.x and it did not applied correctly so I altered the patch.
Comment #40
joseph.olstadworkbench_moderation 7.x-3.x has same issue due to dependancy on drafty which appears to be similar approach to what is done in D8.
patch available here:
#2910310-10: drafty allow publishing current draft from /admin/content page when node already published when Workbench Moderation 7.x-3.x is enabled
Comment #41
imperator_99 CreditAttribution: imperator_99 commentedHi all,
I'm getting the same error on 8.4.0:
Has something rolled back between 8.3 and 8.4?
Cheers,
Jesse.
Comment #42
Sam152 CreditAttribution: Sam152 at PreviousNext commentedRe: #41 are you saying some of those items of content do not have a moderation workflow applied to them? If they all do, it's behaving correctly by protecting them from being directly published/unpublished.
Comment #43
imperator_99 CreditAttribution: imperator_99 commented@Sam152 yes they do. Isn't the problem that you're prevented from directly publishing from /content/admin/? If that's supposed to be the outcome, that's not very useful, especially as a site admin. At the very least there's a UX/UI issue in that the 'actions' drop down has 'publish' as one of the options. If that's not possible, it shouldn't be there.
How do I bulk publish content with content moderation on? Do I really have to push each item through a workflow?
Comment #44
Sam152 CreditAttribution: Sam152 at PreviousNext commentedThe primary issue is, in a view of nodes only certain bundles might be moderated, so removing the action entirely would cause you to lose that feature for rows where it makes sense.
Exactly right, when applying a moderation workflow, we want to make sure content actually goes through those transitions. It would be an access bypass for example if a user with only the "put something in review" permission could publish that content outside of the moderation workflow.
An issue worth pointing out is: #2797583: Dynamically provide action plugins for every moderation state change. The goal there is to represent each one of the states as an action, so the bulk tools can be used in combination with a moderation workflow.
Comment #45
loopy1492 CreditAttribution: loopy1492 commentedSo I wonder what one must do if they have hundreds of nodes which need to be published.