it would be great to show a confirmation overlay similar to edit or delete nodes to prevent publish or unpublish nodes by mistake.

regards

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

AaronBauman’s picture

Version: 7.x-1.0 » 7.x-1.x-dev

The only use case that I could imagine for this behavior is a user who has "unpublish" permissions, but doesn't have permission to view the unpublished content.
In that case, accidentally clicking "unpublish" would bar the user from seeing the content until another user could re-publish.
However, adding a large block of logic and cluttering the workflow for what is essentially an edge case is not something I'm interested in working on.

IMO the point of this module is to have a simple one-click way to publish/unpublish.
I am strongly opposed to injecting a confirm page into the default behavior, but it could work as a config option or under certain specific conditions.

AaronBauman’s picture

Title: confirmation » Add a confirmation dialogue when publishing or unpublishing content
Anonymous’s picture

on my site a user should be able to keep his content private so noone else would be able to see users content besides this content he has published by himself. other users shouldn't be able to publish or unpublish content that isn't their own.

on a users profile there should be 2 views that shows fields from content and the appropriate edit, delete and publish/unpublish links...one for all published nodes and the other for unpublished nodes and maybe friends from the user (using user relationship) or all authenticated users should be able to see the published content.

so if a user publishes his confidental content by mistake maybe he wouldn't realized it. to prevent that an overlay message would be very useful.

esbite’s picture

In my opinion an action that alters data such as Publish/Unpublish should always use a confirmation dialogue that does POST and nonce-validation, as Drupal's Form API does.

Search engines visiting an unpublish url are probably not a valid concern here since login is required, but imagine a browser that automatically fetches pages you might go to next. Chrome already has this feature enabled by default.
http://support.google.com/chrome/bin/answer.py?hl=en&hlrm=en-GB&answer=1...

AaronBauman’s picture

Since Publish Content doesn't have any configuration besides permissions, I think a "skip publish confirmation" and "skip unpublish confirmation" might be a good approach to offer this functionality. I'm happy to consider a patch, but I've no time or interest to write it.

rogical’s picture

+1 this function is very common very useful

Rob_Feature’s picture

Yeah, just voting that this is really needed. It's way too easy for a more novice user to unpublish content and not even really realize what they did.

LiloLilo’s picture

+1 I'd like to see a confirmation form similar to the delete one. One-click actions may drive to undesired results. As a user I would expect to see a confirmation form to submit or cancel.

aadityawalawalkar’s picture

FileSize
2.94 KB

Please find the patch which attaches a confirmation form to Publish and Unpublish tab.

aadityawalawalkar’s picture

Status: Active » Needs review
Simon Georges’s picture

Status: Needs review » Needs work

Would you be willing to add the "bypass confirmation" permission, as suggested in #5 by aaronbauman?

LiloLilo’s picture

#9 worked for me, many thanks!

aadityawalawalkar’s picture

Please find the patch which attaches a confirmation form to Publish and Unpublish tab based on "skip publish confirmation" and "skip unpublish confirmation" permission(s).

Simon Georges’s picture

Status: Needs work » Needs review

Thanks!

Simon Georges’s picture

Testbot ?

Status: Needs review » Needs work

The last submitted patch, Confirm_Form_Permission_Based-1399572-13.patch, failed testing.

Simon Georges’s picture

Needs a re-roll, then.

NWOM’s picture

I manually patched the module using the above patch and it works perfectly. Thanks a lot!

johnennew’s picture

The tests will need updating to accommodate this change.

Anonymous’s picture

Patch #13 works for me, but after the confirmation, I get "You are not authorized to access this page". I don't get that as root admin, but all other user-role ends up with this, even though I have given permission for other roles to see unpublished content.

NWOM’s picture

Issue summary: View changes

The patch still works, but needs to be manually patched since a re-roll is needed.

julou’s picture

Status: Needs work » Reviewed & tested by the community
FileSize
4.15 KB

This patch is very helpful, thanks!
Please find a patch against the dev version attached.

PS: testing fails, I'm sorry I don't know how to handle this (at least the patch is up-to-date with the dev version)

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 22: Confirm_Form_Permission_Based-1399572-22.patch, failed testing.

sanjarhakimi’s picture

Where can I edit the button label from "Unpublish" to something like "Confirm" ?

johnennew’s picture

Patch which fixed tests added. I think I like @sandshakimi suggestion of using Confirm on the form rather than Publish / Unpublish.

johnennew’s picture

Status: Needs work » Needs review

Setting to needs review for testbot

johnennew’s picture

This patch fixes some coding standards issues and string translation issues. Also renames the button text to Confirm rather than the operation.

johnennew’s picture

Status: Needs review » Fixed

Tests passed! Committed! Thanks all.

Status: Fixed » Closed (fixed)

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

anneeasterling’s picture

Unfortunately, the "skip confirmation" didn't make it in the newest module version, 7.x-1.4. Would it be possible to get the "skip confirmation" permission added back in?

Until then, I'm rolling back to the previous version. The user experience for this new confirmation step is confusing to my editors.

Many thanks for your consideration!

chevali’s picture

Is there a way to make this feature optional? we get dozens of content a day and the new update just makes it extra long to publish the nodes ( we need to review them as well, so bulk publish is out of the picture )

efpapado’s picture

Proposing patch for extra permission that will allow to skip the confirmation step.

efpapado’s picture

Moving the discussion to a more proper issue https://www.drupal.org/node/2828633