Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unpublish button appears regardless of "Allow unpublishing from the admin interface." setting #123

Closed
e0Re0R opened this issue Feb 9, 2022 · 1 comment

Comments

@e0Re0R
Copy link

e0Re0R commented Feb 9, 2022

Hi,
I presume the intended behaviour of unticking "Allow unpublishing from the admin interface." is so that the Unpublish/Publish option does not appear when editing a paragraph.

I find that the setting is being ignored. Sorry I don't know enough to provide a diff file.
I'm looking at version 1.x-1.2.0-alpha2, in the paragraphs.field_widget.inc file, in the paragraphs_field_widget_form_build function
At line 602 you have
if (isset($bundle_info->allow_unpublish)) {

which is true even if $bundle_info->allow_unpublish == 0

I changed it to
if (isset($bundle_info->allow_unpublish) && $bundle_info->allow_unpublish) {

and it has worked for me.

Hope this helps.
Noel

@laryn laryn closed this as completed in 3a3bafa Feb 9, 2022
@laryn
Copy link
Member

laryn commented Feb 9, 2022

Thanks @e0Re0R -- good catch. If the setting was turned on and then turned off it remains set and could never be hidden with the previous logic. I've changed isset to !empty which does the equivalent of what you are proposing.

I appreciate the report. This will be in the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants