Hi,
First, thx for your module. It is very helpful.
The module works great, but when node is published after a cron run, the "publish on date" field data disappear on the edit form. There is the same behavior with the unpublish date filed data after unpublishing (by cron job).
When I make a view, I can find the data, meaning that the data are still stored in the database, but doesn't show up after publish/unpublish by cron on the node edit form.
It that normal ? How can I fix it to keep the data one the node edit form ?
Thx
Benjamin

Comments

eric-alexander schaefer’s picture

Status: Active » Postponed (maintainer needs more info)

Its gone on purpose. Why do you need the data after (un-)publishing?

bneel’s picture

Component: Miscellaneous » Documentation

For my situation, I transformed the $form in order to required the (un)publish fields (I added " '#required' => TRUE, ").
In this way, if the (un)publishing data disappear after the cron job and if I want to re-edit the node I have to add again the data.
Can you tell me the code I have to delete (or to add) in order to keep the data on the edit form ?
B.

eric-alexander schaefer’s picture

The publish_on data gets deleted after publishing. You could delete line 382-390, but then the nodes would be published again and again. I would not recommend doing that.

Maybe you should set the #required attribute only if the node is not published yet (e.g. node->status == 0).

bneel’s picture

I'm not good in coding, how to proceed ? Like this ?

'#required' => (node->status == 0) : TRUE,

Thanks again for your help

eric-alexander schaefer’s picture

I can't test it right now, but you could try:

'#required' => (node->status == 0) ? TRUE : FALSE,

This should make the publish_on field be a required field if the node is in unpublished state. If you unpublish the node later (manually or via unpublish_on) the field will be required again.

bneel’s picture

I got a Parse error: syntax error, unexpected T_OBJECT_OPERATOR

bneel’s picture

Ok the answer was :

'#required' => ($node->status == 0) ? TRUE: FALSE,

Thanx for the tip.
Benjamin

eric-alexander schaefer’s picture

Status: Postponed (maintainer needs more info) » Fixed
eric-alexander schaefer’s picture

Status: Fixed » Closed (fixed)
bartezz’s picture

First of all a very nice module. I'm using it in combination with header_image.module and it works like a charm!

It would be nice for purpose of reference (with multiple website moderators) to see when a node was (un)published.
I understand the module would publish again and again... not sure how you've programmed it but couldn't you make it so that the date will be kept and the module won't publish again and again.

if($alreadypublished) { do nothing...

Just a thought :)

Cheers

eric-alexander schaefer’s picture

It should not publish again and again. Does it do that?
You can access the (un)publish times in your theme via $node->scheduler['published'] and $node->scheduler['unpublished'].

BTW: Please file a new issue (support request?) for new problems/discussions.

Regards,
Eric