Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
In Drupal 8.4 the "Save and keep unpublished" and "Save and keep published" buttons were replaced with a single checkbox.
It's currently not possible to show that checkbox for roles other than the main site administrator role/user.
Is this something this module should do?
Comment | File | Size | Author |
---|---|---|---|
#12 | interdiff-9-12-without-deletions.patch | 6.29 KB | jwilson3 |
#12 | Screen Shot 2020-05-18 at 9.04.20 PM.png | 40.85 KB | jwilson3 |
#12 | Screen Shot 2020-05-18 at 9.04.30 PM.png | 147.87 KB | jwilson3 |
#13 | publishcontent-checkbox-ui-2932094-13.patch | 6.67 KB | jwilson3 |
#13 | interdiff-2932094-12-13.txt | 410 bytes | jwilson3 |
Comments
Comment #2
dddbbb CreditAttribution: dddbbb as a volunteer commentedBig +1 for this if it's possible.
The current system whereby the "Publish" or "Unpublish" option is available as a tab alongside "View" & "Edit" is clunky and also means that a node must first be saved (and consequently published!) in order for these options to become available.
Comment #3
Lennard WesterveldHi all,
I created a patch that uses the published checkbox that shown default on nodes.
Its not the prettiest way of doing it but it is functional! I reused also PublishContentAccess class in a way thats not ment for.
I also showing the checkbox when the user not having the permission to edit it but then i disable it and add a description to it.
Feel free to edit the code to your liking, and changes are always welcome!
Comment #4
demonde CreditAttribution: demonde commentedTo me this patch works fine.
But using the "Inline Entity Form" module the checkbox stays invisible.
https://www.drupal.org/project/inline_entity_form
Comment #5
fran seva CreditAttribution: fran seva as a volunteer and at Bluespark commentedHi - It seems the patch does not apply, I have attached a new one after reroll it.
Comment #6
rodrigoaguileraThis module current functionality is to add a local task tab for publishing/unpublishing and it doesn't deal with the checkbox.
I don't think we can remove the tab without disrupting the current users of the module and the latest patch does exactly that.
Other concern I have about the patch is that it show the checkbox unconditionally and then it performs the logic. This might be a problem with other alter hooks.
One module that deals with the checkbox is Override node options but it overlaps many features with publishcontent. If people are interested in the additional features o f this module maybe we can think of a 2.0 version that relies on the Override node options module for permissions(as a dependency) and then add features on top.
What do you think?
Comment #7
liquidgnome CreditAttribution: liquidgnome as a volunteer and commentedA minor fix to coding standards in PublishContentLocalTask broke the patch from #5. Fixing and re-uploading.
Comment #8
liquidgnome CreditAttribution: liquidgnome as a volunteer and commentedmissed some things from #5, which made patch 7 useless.
Comment #9
GPZ CreditAttribution: GPZ commentedI confess I use this patch too.
I couldn't apply any of the previous patches for the version 8.x-1.1
So I took the first one and re-applied the same steps in this version.
Comment #10
M_Z CreditAttribution: M_Z commented@GPZ : thank you for the updated patch in comment #9 (above) #2932094-9: Add support for new Drupal 8.4 publish checkbox that works very well with version 8.x-1.1
and I am sad that this patch won't be applied to a next module release
@rodrigoaguilera : what do you think if a configuration option would be added to switch from (default) tab implementation to a checkbox implementation?
Comment #11
rodrigoaguilera@M_Z feel free to reopen this issue and post a patch that implements the switch. I'll be happy to review it and incorporate it.
Comment #12
jwilson3I'm back on this issue after updating to latest 8.x-1.x branch, the patch in #9 no longer applies.
Sadly, the way this issue is currently devised this patch would literally need a re-roll after almost any modification to the underlying codebase, because the patches are deleting the module's existing functionality.
Due to the above, and the fact that the maintainer wouldn't commit it in the current state on #9, this patch does a couple things:
1.- Most importantly, unlike previous patches, we no longer delete the Local Tasks functionality, but make it optional, and enabled by default. Note that in the interdiff-9-12-without-deletions.patch I've excluded the re-addition of existing files that got deleted in previous patches in order to make it more logical about what new functionality is really being added here.
2.- Add config options to let users decide which UI they want to use: Local Tasks vs Checkbox. The config is setup so that either option or both options may be enabled or disabled independently. Local Tasks are enabled by default and the Checkbox is disabled by default to keep the module working the same way for existing installations.
3.- Exposes these configuration settings in the Admin UI under Admin > Config > Workflow > Publish content.
I hope Rodrigo finds this solution more acceptable.
Comment #13
jwilson3Turns out Drupal wants yaml data types consistent with their schema.
Comment #15
rodrigoaguilera@jwilson3 That is a great patch making this module much more flexible.
Thank you for the contribution.
Comment #16
jwilson3Awesome! Thanks for the commit!
Comment #17
jwilson3This probably needs some documentation updates I guess.