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.
Is there any way to get the publish checkbox to show up on node add forms for users with permission to publish/unpublish? On the first line of the _publishcontent_publish_access() function there is a check for empty($node->nid). This seems to prevent the publish checkbox from appearing on node add forms for these users.
Comment | File | Size | Author |
---|---|---|---|
#3 | publishcontent-1918322-3-publish_box_on_node_add_form.patch | 1.35 KB | Simon Georges |
Comments
Comment #1
AaronBaumanPublishcontent module has nothing to do with the publish checkbox.
The publish checkbox, under publishing options, is a core drupal field.
Publishcontent was designed to be a super-lightweight module to provide a local action (ie. a tab) for one-click publishing and unpublishing.
I believe this is explained in the README and possibly elsewhere, but if not it should be.
Comment #2
tdway CreditAttribution: tdway commentedIn publishcontent_form_alter() the publish checkbox access is enabled if the current user has permission to publish/unpublish. On node edit forms it seems to set this correctly, but on node add forms it seems to fail because of the empty($node->nid) check. Does this module intentionally enable the publish checkbox on node edit forms, but not on node add forms?
Comment #3
Simon Georges CreditAttribution: Simon Georges commentedIs it better with this (and did I break something else)?
Comment #4
Simon Georges CreditAttribution: Simon Georges commentedThis is actually only useful on the "publish" function, as I don't see how you could have a publish node without nid, but anyway, to preserve the symmetry of the code, I went ahead and committed it.
Please shout at me if you find any side effect.
Comment #6
NWOM CreditAttribution: NWOM commentedI hope it's ok to reactivate this topic.
Rather than forcing the Publishing Options, could it instead be optional? I activated the "Tab" option, and would rather the Publishing Options form not be displayed at all.
Of course hiding it via CSS is an option as well, but I figured this is something that I'm sure other users could use.
Thanks in advance.
Comment #7
johnennew CreditAttribution: johnennew commentedI (personally) don't see the value of hiding the standard Drupal publish controls for people with the ability to publish or unpublish the content and don't think it should be a function of this module to hide it.
Site builders can always do it via hook_form_alter for their site or via CSS as you suggest if their site needs it.
What do others think? Would be happy to consider patch submissions for this.
Comment #8
NWOM CreditAttribution: NWOM commentedWell, the biggest problem that I'm experiencing is that via CSS I can only remove all Additional options, which isn't good since this wouldn't be role based. I would like the Administration role to still be able to edit these options.
And I'm using the Jammer module which normally removes the publishing options, but this module seems to reactivate it and ignores the settings in Jammer.
Would reverting the lines in the above patch accomplish temporarily what I'm looking for?
Thanks in advanced for any help.