If a node is scheduled to be published in the future, but a user checks 'published' in publishing options, the module unpublishes the node in hook_nodeapi and displays a message to the user.

This doesn't seem logical, as the user is submitting something that they should not be. It is not possible to publish the node if it is scheduled to be published in the future. A form error is more appropriate.

Attached is a patch that does just that. Any chance this can get included in the module?

Comments

blairski’s picture

StatusFileSize
new1.23 KB

There is a mistake in the above patch, so attached is the fixed one.

Now it checks if the node status is 1 (published) and if so, throws the error, otherwise it displays the original message.

jonathan1055’s picture

Hi,
I'm not exactly sure of your logic, but before we go any further, I think your second patch is a patch on top of your first. What we really should see is a patch against the original. Foer example the line $node->status does not appear in your second patch file.

Also, any patches should be done against D7 first.

Jonathan

eric-alexander schaefer’s picture

Status: Active » Closed (works as designed)

The default for a node type might be "published". The user would have to change that to "unpublished" manually every time a node is to be scheduled or otherwise a form error is displayed. I don't think this would be desirable. Setting the state to "unpublished" automatically when a node is to be scheduled makes more sense.

jonathan1055’s picture

Yes that is a conclusion I came too, it is specifically designed to do that. You can only have automation one way ;-) If the user wants the node to be published immediately they need to remove the scheduled publishing date.