Doctrine 1
  1. Doctrine 1
  2. DC-694

Doctrine_Record::replace() discards Doctrine_Expression values, uses empty value instead

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.2.1, 1.2.2
    • Fix Version/s: 1.2.3
    • Component/s: Record
    • Labels:
      None
    • Environment:
      php 5.3.0 @ Windows XP SP3
      MySQL 5.1.40 @ Windows XP SP3

      Description

      I experienced a bug when working with a datetime field that only rears its head when I use $record->replace()

      //  BUG!!
      $record->date_created = new Doctrine_Expression('NOW()');
      $record->replace();
      // date_created will be 0000-00-00 00:00:00, i.e. empty
      
      // WORKS FINE!
      $record->date_created = '2022-12-23 14:14:12';
      $record->replace();
      
      // WORKS FINE!
      $record->date_created = new Doctrine_Expression('NOW()');
      $record->insert();
      
      // WORKS FINE!
      $record->date_created = '2022-12-23 14:14:12';
      $record->insert();
      
      

        Activity

        Hide
        Jonathan H. Wage added a comment -

        Thanks for the issue and description. I committed a fix that addresses the problem.

        Show
        Jonathan H. Wage added a comment - Thanks for the issue and description. I committed a fix that addresses the problem.

          People

          • Assignee:
            Jonathan H. Wage
            Reporter:
            Exception e
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: