Event start and end times not getting saved in database

nated - December 15, 2005 - 18:54
Project:Event
Version:5.x-2.x-dev
Component:Code
Category:bug report
Priority:critical
Assigned:Unassigned
Status:closed
Description

I'm using Drupal 4.7 beta1 and the CVS version of event from 2005-12-14, and when I create or edit content with an event the start and end times do not save. The database fields event_start and event_end both contain "0" and the date displayed on the site is "1970-01-01 00:00".

I did a little digging and found that $node->event_start and $node->event_end are not populated in the 'insert' case of event_nodeapi() near line 1814 of event.module. If I revalidate the fields by changing the 'insert' case to this:

<?php
     
case 'insert':
       
event_validate_form_date($node, 'start');
       
event_validate_form_date($node, 'end');
       
db_query('INSERT INTO {event} (nid, event_start, event_end, timezone) VALUES (%d, %d, %d, %d)', $node->nid, $node->event_start, $node->event_end, $node->timezone);
       
event_set_range();
        break;
?>

It works. However, I'm not sure that's the best solution.

Please let me know if more info is needed. Thanks.

#1

Waldemar - December 18, 2005 - 20:39

See #15 in http://drupal.org/node/40107. If you update to the latest CVS you should not experience the bug anymore.

#2

maartenvg - April 4, 2007 - 07:36
Status:active» closed
 
 

Drupal is a registered trademark of Dries Buytaert.