Topic
No replies
SystemAdmin
SystemAdmin
162 Posts
ACCEPTED ANSWER

Pinned topic Part 6: announcement_insert/update bug

‏2006-10-17T04:17:52Z |
The function _announcement_drupal2unixtime() should not be used in the announcement_update() and announcement_insert() functions from Part 6 of the Drupal tutorial.

The announcement_submit() function already sets the $node->publish_date and $node->expiration_date values to a unix formatted value. Using the _announcement_drupal2unixtime() function again in the insert and update functions resulted in both dates being set to Nov 30, 1999.

These lines:
code
$publish_date = _announcement_drupaldate2unixtime($node->publish_date);
$expiration_date = _announcement_drupaldate2unixtime($node->expiration_date);
[/code]

Should be replaced by:
code
$publish_date = $node->publish_date;
$expiration_date = $node->expiration_date;
[/code]