Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Goal: To hide the 'Send subscriptions notifications' checkbox when editing or creating a node.
On admin/config/system/subscriptions, under Content Settings, I have:
- selected all content types listed under 'Unlisted content types'
- selected all content types listed under 'Blocked content types'
- selected all content types listed under 'Static content types'
The user only has the 'Subscribe to content' permission and no others for the subscription module.
And yet, when a user goes to create a new node of any content type, at the bottom is the checkbox for 'Send subscriptions notifications'. What am I missing to hide the 'Send subscriptions notifications' checkbox??
Thanks.
Comments
Comment #2
salvisYou are confused about how things fit together.
The 'Send subscriptions notifications' checkbox is completely unrelated to subscribing.
It is part of the 'Publishing options' tab (along with 'Published', 'Promoted to front page, and 'Sticky at top of lists') which is exposed only for users that have the 'administer nodes' permission. Normal users don't see that tab.
Comment #3
rajmataj CreditAttribution: rajmataj commentedSo, for anyone that can administer nodes, they will see this option no matter what. This tends to confuse a lot of my clients (working with a site that has about 100 'site owners' who can administer nodes and who, in turn, manage hundreds of less privileged editors, etc). I think I will create a custom module with a permission specifically designed to not render this control. Does this seem reasonable to bake into a future release?
Regardless, thanks for the clarification.
Comment #4
salvisNo, this is part of the fine-tuning that you need to implement yourself if your site has some very specific requirements.
I'd be surprised if you really did not need to have that option available though, even at the expense of having to educate your 'administer nodes' users.
Comment #6
kyleheney CreditAttribution: kyleheney commentedHi,
I am looking for a way to grant access to the Subscriptions options (under Publishing Options) for users that do not have the "Administer Content" permission. On our site, the "Administer Content" permission would open up way too many security holes, but I'd still like them to have the option to toggle Subscription notifications when editing their nodes.
I understand that some custom programming will be needed (sounds like using "hook_form_alter()" is needed). I have never needed to do this sort of thing on our site, so I'm looking for some assistance in how to make this happen. Basically, I'd like the "Send Subscription Notifications" to be visible for users of certain roles for certain content types.
Any help is very much appreciated.
Comment #7
scuba_flyYou could change line 502 of the subscriptions_content.module (version 1.3) to include an access check.
And then you still need to create the permission.
If I find time in the future I'll create a patch for it.
Comment #8
Abelito CreditAttribution: Abelito commentedThe least that the module should do, is hide this option (Send Subscription Notifications) for content types that are not available to subscribe to.
I'm also interested in this feature.
Comment #9
salvisUser 1 and additional roles (depending on permissions) can subscribe to all content types.
The people who see this option should know this...
Comment #10
Abelito CreditAttribution: Abelito commentedI see, so it is two conflicting Features.
Some people may want to keep that checkbox option for nodes that are not available to subscribe to, because permissions override the Subscription settings, and some roles may still be able to subscribe to all content types.
The clunky workaround is to use css to hide that option on the add/edit page for all content, and display it for specific content types.
Comment #11
salvisEither way, hook_form_alter() is the way to go here.