Running Drupal 6.11. Using "copy & paste" action code.

Have only one custom content type set to expire after 1 month. All other content types should not have expiration.
Applied patches ( here and here) to fix default date of 1970-01-01 and to hide fields which were appearing in Image content type -- others were working fine.

However, whenever I publish an Image, Node Expire adds the node to the node_expire table with a value of 0 in the "expire" column. When cron is run, the module acts as though the Image node has expired and unpublishes it.

Any ideas on how to fix this???

Comments

barckhoff’s picture

Title: Image nodes saved in node_expire table with value of 0 then unpublished » Nodes saved in node_expire table with value of 0 then unpublished

Now this is happening with book nodes also....

smsearcy’s picture

I posted an update to #426636: Errors on cron run that should fix the problem. Please let me know if it helps.

barckhoff’s picture

Thank you, smsearcy!!! I applied the modified patch posted by arthurf and it seems to be working.

Now the only issue I have is to get it to stop subtracting one day from the expiration date each time the node is edited. Any ideas on how to do that?

smsearcy’s picture

I'm not sure since I didn't run into that issue. Is the expiration date displayed when editing a node (assuming you have edit node permissions enabled) the correct or incorrect value? If it's displaying incorrectly, I think that is set in _node_expire_form_alter_nodeform() in node_expire.nodeapi.inc. I've made some changes so mine looks like this at the beginning of the function (I think I based this on the default date code posted at #405608: Empty Expiration Date Field is filled with bad information! - default Expiration Date set to '1970-01-01').

function _node_expire_form_alter_nodeform(&$ntypes, &$form, &$form_state, $form_id) {
  // Check if the Node Expire feature is enabled for the node type
  $node = isset($form['#node']) ? $form['#node'] : NULL;

  // Convert the timestamp into a human readable date
  if (is_numeric($node->expire)) {
    if ($node->expire != 0) {
      $node->expire = format_date($node->expire, 'custom', NODE_EXPIRE_FORMAT);
    } else {  // expiration date is 0, set default if available
      if (!empty($ntypes['default'])) {
        $node->expire = format_date(strtotime($ntypes['default']), 'custom', NODE_EXPIRE_FORMAT);
      } else {
        $node->expire = '';
      }
    }
  }

I hope that can be of some help.

barckhoff’s picture

Status: Active » Closed (fixed)

Wow, sorry for the delayed response, I had moved on to other things for awhile.

Well, I tried inserting your new code, but it didn't seem to work for me.

Anyway, the -1 day issue is more appropriately addressed here: http://drupal.org/node/435658, so I guess this one should be closed.

Thanks for your help.