Problem/Motivation

Currently, even if a user does not have publish access on a content type, they can create published content. I believe content created by those users should be unpublished by default.

Steps to reproduce

1. Set the Article content type to be Published by default
2. Create a role that can create articles
3. DO NOT give that role publish permission for articles
4. The user will create published articles by default

Proposed resolution

Set the default value for Published to FALSE when the user does not have publish permissions.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

stefan.butura created an issue. See original summary.

stefan.butura’s picture

StatusFileSize
new660 bytes
vinaysamant’s picture

i was struggling a lot to get this module configured as my expectations that were close to your's.
I wonder why is this not inbuilt in Drupal even after 10. They have some monster like Content Moderation & Workflows but not something very basic like "publish content". anyways..

In this, i think major issue is with documentation of module : "After enabling it, you first need to choose the content types this will work with. Goto Structure -> Content Types then edit each that should work with this module. Tick the "Enable publish content" tickbox under the publishing options and save.". This is totally missing.

Module has independent setting under Workflows menu "Publish Content" submenu. There is an option "Publish and unpublish via checkbox" which is uncheck by default. But if you enable this then it sorts everything. Additional option to set "status" appear on content creation form. In Content Type setting's keep option of "Published" unchecked. So by default content is unpublished. For every user. But when user has "Publish Content" permission, "status" can be set. Otherwise this option is visible but disabled. This is really useful, mainly w/o using any patch or making any programming changed. Unfortunately it's not properly documented.

rodrigoaguilera’s picture

Please feel free to propose changes to the documentation. If the community agrees on the changes I pledge to review and merge them.

I don't dedicate much time to this module anymore but I try to pay attention to the MRs that are affecting a lot of folks.

vinaysamant’s picture

where should i write the documentation? Can i write it here in my next comment?

Also i have a small feature request, if you can spare some time and help.. plz where should i post it?

rodrigoaguilera’s picture

Hello Vinay

You can open an issue for that.

Take the text from https://www.drupal.org/project/publishcontent
and turn it in to Markdown for a readme.md file for the root of the repo. That should be one commit.
Then in successive commits you can improve that description/docs for easier review.
You should open a MR with your commits.

Once the changes have been approved by the community I can take care of using that readme.md file for updating the main page description of the module.

vinaysamant’s picture

i created an issue for documentation few months ago. did u see it?

astonvictor made their first commit to this issue’s fork.

astonvictor’s picture

Status: Active » Needs review
rodrigoaguilera’s picture

@astonvictor Can you explain more about the change?

Seems like it is not enough to disable the widget since the widget has a default value of "1".

astonvictor’s picture

Status: Needs review » Fixed

merged

Now that this issue is closed, please review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, please credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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