Doctrine 1
  1. Doctrine 1
  2. DC-674

NULL Dates are translated to '0000-00-00' after upgrading to 1.2.2

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Critical Critical
    • Resolution: Unresolved
    • Affects Version/s: 1.2.1, 1.2.2
    • Fix Version/s: 1.2.1, 1.2.2
    • Component/s: Behaviors
    • Labels:
      None
    • Environment:
      Zend Framework, Ubuntu 9.10, MySQL

      Description

      Once the upgrade was done from Doctrine 1.2.1 to 1.2.2 we discovered that date related issues started to appear.
      With dates that are persisted in DB as NULL are translated to "0000-00-00" when retrieved from DB. This has occurred in multiple places and is quite worrying as there is a lot of dates in our project. This means that everywhere in our codebase where we check a datevalue in our Models is NULL we need also to check for the string literal "0000-00-00".

        Activity

        Ville Itämaa created issue -
        Ville Itämaa made changes -
        Field Original Value New Value
        Summary NULL Dates are translated to '0000-00-00' NULL Dates are translated to '0000-00-00' after upgrading to 1.2.2
        Affects Version/s 1.2.2 [ 10047 ]
        Affects Version/s 1.2.1 [ 10044 ]
        Environment Zend Framework, Ubuntu 9.10, MySQL
        Description Once the upgrade was done from Doctrine 1.2.1 to 1.2.2 we discovered that date related issues started to appear.
        With dates that are persisted in DB as NULL are translated to "0000-00-00" when retrieved from DB. This has occurred in multiple places and is quite worrying as there is a lot of dates in our project. This means that everywhere in our codebase where we check a datevalue in our Models is NULL we need also to check for the string literal "0000-00-00".

        Priority Major [ 3 ] Critical [ 2 ]
        Fix Version/s 1.2.2 [ 10047 ]
        Fix Version/s 1.2.1 [ 10044 ]
        Component/s Behaviors [ 10017 ]
        Roland Huszti made changes -
        Comment [ I just tested this with Doctrine 1.2.3, and it works fine for me. Maybe the base models are missing some parameter.

        {noformat}

        YAML

        fieldname:
                    type: timestamp(25)
                    notnull: false
                    default: null

        BASE MODEL

                $this->hasColumn('fieldname', 'timestamp', 25, array(
                     'type' => 'timestamp',
                     'notnull' => false,
                     /* 'default' => null, */ /* works fine without this */
                     'length' => '25',
                     ));

        {noformat} ]

          People

          • Assignee:
            Jonathan H. Wage
            Reporter:
            Ville Itämaa
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated: