Found by mauryg in #572916: Optional admin approval:
The date of creation of bookings is either not set or not displayed correctly.

CommentFileSizeAuthor
#4 publicbookings.573612-2.patch2.22 KBAnonymous (not verified)

Comments

Anonymous’s picture

Status: Active » Fixed

Its committed.

Index: publicbookings.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/publicbookings/publicbookings.module,v
retrieving revision 1.13.2.9
diff -r1.13.2.9 publicbookings.module
2c2
< // $Id: publicbookings.module,v 1.13.2.9 2009/09/04 12:00:39 tirsales Exp $
---
> // $Id: publicbookings.module,v 1.13.2.8 2009/06/26 15:01:30 tirsales Exp $
447,449c447
<         if ($using_sql_ts_triggers) {
<           $values['created'] = date(DATE_FORMAT_DATETIME);
<         }
---
>         $values['created'] = date(DATE_FORMAT_DATETIME);
453,455c451
<         if ($using_sql_ts_triggers) {
<           $values['modified'] = date(DATE_FORMAT_DATETIME);
<         }
---
>         $values['modified'] = date(DATE_FORMAT_DATETIME);
mauryg’s picture

Status: Fixed » Needs work

@tirsales

I installed the DEV version I downloaded yesterday on my live site. I confirmed that the publicbookings.module contains the patch.

      $using_sql_ts_triggers = variable_get('bookingsapi_using_sql_ts_triggers', FALSE);
      if (empty($values['client_id'])) {
        $update = array();
        if ($using_sql_ts_triggers) {
          $values['created'] = date(DATE_FORMAT_DATETIME);
        }
      } 
      else {
        $update = 'client_id';
        if ($using_sql_ts_triggers) {
          $values['modified'] = date(DATE_FORMAT_DATETIME);
        }
      }

I created a booking, confirmed it then updated it. When I looked at the update page again the creation data was still 0000-00-00 00:00 and the modified date was blank. Then I read your code and noted that it REQUIRES that the SQL triggers option be checked. When I did that and repeated the process, the creation date was correct but the modified date was still blank. I confirmed this using phpMyAdmin to check the table in the database. The modified date was still 0000-00-00 00:00.

Anonymous’s picture

Actually the patch should REMOVE the need to use "using_sql_triggers" ... I guess I committed the wrong version.

Anonymous’s picture

StatusFileSize
new2.22 KB

I just got the dev from the server and the patch (removing the need for bookingsapi_using_sql_ts_triggers) is in. But I forgot another thing (committed and attached)

Anonymous’s picture

Version: 6.x-1.0-alpha4 » 6.x-1.x-dev
Status: Needs work » Needs review
Anonymous’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.