For content I created before I installed auto_extend, I get the message

Warning: date_timezone_set() expects parameter 1 to be DateTime, boolean given in format_date() (line 1909 of /var/www/classifieds/htdocs/includes/common.inc).

And the message on the extend tab is "Blue dress for sale has expired on .", so there is no expiry date. I'm guessing this is an issue with content added before I installed the module. Have a feeling the extend tab shouldn't even appear for this node, it is well under the expiry time still.

Comments

Mir’s picture

It happens when you click the Extend tab of the node created before Auto Expire module has been installed. Auto Expire keeps expiration date in its own {auto_expire} table and inserts entry via hook_node_insert (on node creation).

When you click the Extend tab it calls

$expire = _auto_expire_get_expire($node->nid);
...
function _auto_expire_get_expire($nid) {
    return db_query('SELECT expire FROM {auto_expire}
    WHERE nid = :nid', array(':nid' => $nid))->fetchField();
  }
...

and then pass $expire into format_date($expire).

So if you have no entry for the given nid in {auto_expire} table _auto_expire_get_expire($nid) returns false and you see this warning.

joekrukosky’s picture

Assigned: Unassigned » joekrukosky
Status: Active » Needs review
StatusFileSize
new3.78 KB

Thanks giraffian and Mir. I have made some changes to catch and handle this in an nicer fashion. I have include a patch, which if passes review I will include in the next dev push.