8.x-1.2 worked with 8.9.15 as expected. However the newest version stops showing both the checkbox and the button when editing a node.
Permissions configured as before.

(This is not about the checkbox in Structure -> Content Types described in the documentation. See https://www.drupal.org/project/publishcontent/issues/2996216 for details on that documentation issue.)

Another user can also reproduce this issue: https://www.drupal.org/project/publishcontent/issues/2996216#comment-141...

No debug log entries whatsoever..

CommentFileSizeAuthor
#11 no-checkbox-or-button-3218091.patch596 bytesashrafomar
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

tgoeg created an issue. See original summary.

seutje’s picture

Same issue here, checkbox disappeared after updating Core & contrib.

dercheffe’s picture

Priority: Normal » Major

Same issue here. This is a major issue IMO, because this kind of behavior makes the module useless.

Edit:
On the project page is written:

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.

There is no option like that in my D8 site content type configuration. Only in the user permission settings I can set the privileges. Is this normal or part of the bug/issue?

tgoeg’s picture

This is normal.
The checkbox in Structure -> Content Types not being there is a separate "issue", i.e. it is a non-issue. Reading the related issue https://www.drupal.org/project/publishcontent/issues/2996216 it seems this checkbox has been there on 7.x and the documentation does not reflect that change yet.

This issue is about the module not doing anything at all, as the checkbox when editing a node is gone.

tgoeg’s picture

Issue summary: View changes
tgoeg’s picture

As these two issues both lead to the same problem, they seem to be hard to tell apart. I tried to clarify with a topic update.

dercheffe’s picture

Thanks @tgoeg for clarifying.

This issue is about the module not doing anything at all, as the checkbox when editing a node is gone.

This I can confirm too.

dercheffe’s picture

After some further testing, I can confirm, that Drupal 8.9.16 (current Drupal 8 release) and 8.x-1.2 are working in combination as expected.
Perhaps a release roll back would make sense.

dercheffe’s picture

Title: 8.x-1.3 + Drupal 8.9.16: No checkbox or button » 8.x-1.3 + Drupal 8.9.16: No checkbox or button (release rollback?)
dercheffe’s picture

Status: Active » Needs review
ashrafomar’s picture

StatusFileSize
new596 bytes

First update the settings here /admin/config/workflow/publishcontent

One of other issue is coming from the publishcontent.module file publishcontent_form_node_form_alter
line 27
(!empty($form['status']) && !isset($form['status']['#access'])) this will return false since the $form['status']['#access'] exit, hence the step of adding/allowing the access to publish is skipped

I changed this (!empty($form['status']) && !isset($form['status']['#access'])) to (!empty($form['status']) && isset($form['status']['#access']))
and everything is working as expected.

I'm not 100% sure what was the purpose of checking $form['status']['#access'] is not set, so the author will need to review this.

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

rodrigoaguilera’s picture

Title: 8.x-1.3 + Drupal 8.9.16: No checkbox or button (release rollback?) » 8.x-1.3 + Drupal 8.9.16: No checkbox or button
Version: 8.x-1.3 » 8.x-1.x-dev

I think there was some bad logic introduced here:
https://www.drupal.org/project/publishcontent/issues/3023951

I opened a merge request to change the logic from isset to empty. Please review.

You can apply it as a patch with this URL
https://git.drupalcode.org/project/publishcontent/-/merge_requests/1.patch

With that path the checkbox should be back for users with permission. When I get some confirmation I can roll a release.

I am not sure we should worry about the button since now Drupal core only uses the checkbox.

The tab action worked fine in my testing

dercheffe’s picture

I am not sure we should worry about the button since now Drupal core only uses the checkbox.

What button do you mean?

The patch in #14 worked great for me thx.

rodrigoaguilera’s picture

I read the issue title and I imagined it was referring to the button that existed in Drupal 8.3 and below before the checkbox that was a little Dropdown with two options
The change record:
https://www.drupal.org/node/2847274

I believe the module still has some code to deal with both the checkbox and the button but I am not sure if the original poster was referring to that button.

tgoeg’s picture

Yes, I also did refer to the mentioned button. I did not know this hasn't worked since 8.3+ anymore. The documentation clearly seems to be outdated.
If there's still code dealing with the button, this should be removed as well if it's not used anymore.
(Though the button might be practical, as it gets you the same functionality without loading the content edit page as it seems from the screenshots in the documentation)

rodrigoaguilera’s picture

Title: 8.x-1.3 + Drupal 8.9.16: No checkbox or button » 8.x-1.3 + Drupal 8.9.16: No checkbox

I edited my previous comment to link to the proper Change record
https://www.drupal.org/node/2847274

That button is inside the content edit page so I guess there is some confusion around that. I will remove it from the Issue title

tgoeg’s picture

Sorry. I can't seem to find this anymore, but remember having seen a button in the context menu of a node (the "pen" icon), adding an "(un)publish" option next to "edit" and "configure block" (or similar). Maybe I mixed it up with some other module.

If the button you refer to is inside the content edit page then I'd definitely say remove the functionality, the checkbox is the accepted way of performing this (as user with "administer blocks" permission), so it should be like this when granting permissions with this module as well.

dercheffe’s picture

AFAIK the module offers two opportunities:

  • the puplish checkbox as part of the node edit form
  • a publish/unpublish tab next to "view" and "edit" tab for the node

Depending on the building concept of the site both opportunities making sense. IMO every site builder should be able to decide what kind of opportunity fit's in better (per content type) into the site building concept.

jaydarnell’s picture

Patch #14 seems to fix the problem.

dercheffe’s picture

Status: Needs review » Reviewed & tested by the community

Patch #14 seems to fix problem. Would vote for a new module release where this patch is included.

rodrigoaguilera’s picture

Status: Reviewed & tested by the community » Fixed

Released 1.4
Thanks everyone for the patience

Status: Fixed » Closed (fixed)

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