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?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Jodan created an issue. See original summary.

dddbbb’s picture

Big +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.

Lennard Westerveld’s picture

Hi 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!

demonde’s picture

To me this patch works fine.

But using the "Inline Entity Form" module the checkbox stays invisible.

https://www.drupal.org/project/inline_entity_form

fran seva’s picture

Hi - It seems the patch does not apply, I have attached a new one after reroll it.

rodrigoaguilera’s picture

Status: Active » Closed (works as designed)

This 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?

liquidgnome’s picture

A minor fix to coding standards in PublishContentLocalTask broke the patch from #5. Fixing and re-uploading.

liquidgnome’s picture

FileSize
2.01 KB

missed some things from #5, which made patch 7 useless.

GPZ’s picture

I 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.

M_Z’s picture

@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?

rodrigoaguilera’s picture

@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.

jwilson3’s picture

I'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.

jwilson3’s picture

Turns out Drupal wants yaml data types consistent with their schema.

rodrigoaguilera’s picture

Status: Needs review » Fixed

@jwilson3 That is a great patch making this module much more flexible.

Thank you for the contribution.

jwilson3’s picture

Awesome! Thanks for the commit!

jwilson3’s picture

This probably needs some documentation updates I guess.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.