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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

AaronBauman’s picture

Publishcontent 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.

tdway’s picture

In 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?

Simon Georges’s picture

Status: Active » Needs review
FileSize
1.35 KB

Is it better with this (and did I break something else)?

Simon Georges’s picture

Status: Needs review » Fixed

This 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.

Status: Fixed » Closed (fixed)

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

NWOM’s picture

Category: bug » feature
Status: Closed (fixed) » Active

I 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.

johnennew’s picture

I (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.

NWOM’s picture

Well, 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.

  • Simon Georges committed c5f62c1 on 8.x-1.x
    Issue #1918322 by tdway, Simon Georges: Displaying publish option on...