Bulk operations actions skip "publishcontent" defined permissions.

The users cannot publish / unpublish content with bulk operations even if all the publishcontent defined permissions are checked.

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

mpastas created an issue. See original summary.

DeFr’s picture

Status: Active » Needs review
StatusFileSize
new795 bytes

Had the same issue.

Attached patch fix it by implementing hook_entity_field_access_alter.

RAWDESK’s picture

Reviewed and tested successfully.
PS. There's something wrong with the testing queue which provides a D7 PHP5 test.

tlwatson’s picture

+1. This patch worked for me - it applies 1.1 without issues.

UPDATE: turns out not so much. I can now publish/unpublish content I authored, but NOT that someone else authored, from the /admin/content page. I have permission to do so and can do it individually from the node page.
Turns out this may be an issue with content_moderation.

tlwatson’s picture

Version: 8.x-1.x-dev » 8.x-1.1
dionsj’s picture

As mentioned in #3, the test shows it as the D7 version, but this patch is for the D8 version (as the issue also correctly states), just mentioning it here as I was initially quite confused.

I have also applied the patch to 8.x-1.1 and it applies cleanly (creates the missing .module file with the hook from the patch)

As mentioned in #4, there may be issues with content moderation, as without the module I can publish/unpublish content from other users just fine, but with it I can only do so with my own content.

+1 from me for this patch, it makes the module work with Views Bulk Operations (VBO).

anfor’s picture

Version: 8.x-1.1 » 8.x-1.2
StatusFileSize
new1.04 KB

The publishcontent.module has since been created, I reroll previous patch for 8.x-1.2 release.

seutje’s picture

Version: 8.x-1.2 » 8.x-1.6
Status: Needs review » Reviewed & tested by the community

Patch in #7 still applies cleanly and does the trick.

natemow’s picture

Reroll for 1.7.

berliner’s picture

Last patch applies properly to 1.7. Thanks for the re-roll.

la558’s picture

Patch @#9 worked perfect for allowing bulk operations.
Thanks
However, although I have it set to "Create new revision when publising/unpublishing a node" when performing bulk operations it does not create a new revision.

Are you aware of any workaround for this?

berliner’s picture

Re-rolled patch for 1.8. Changes are identical but this one plays nicer with composer-patches v2.

robcarr’s picture

Version: 8.x-1.6 » 8.x-1.8

Patch at #12 works great with latest release. Thanks for everyone's work on this