Doctrine 1
  1. Doctrine 1
  2. DC-649

Getting Doctrine_Validator_Exception on Doctrine_Record::replace() when using unique

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 1.2.2
    • Fix Version/s: None
    • Component/s: Record
    • Labels:
      None
    • Environment:
      PHP 5.3.2, MySQL 5.1.46

      Description

      Using this code:

      $user = new User();
      $user->mail = 'mail@mail.mail';
      $user->save();
      $user2 = new User();
      $user2->mail = 'mail@mail.mail';
      $user2->replace();

      I get the following exception:

      Fatal error: Uncaught exception 'Doctrine_Validator_Exception' with message 'Validation failed in class User: 1 field had validation error: 1 validator failed on mail (unique)' in D:\Workspace\Doctrine\Doctrine\Transaction.php:265
      Stack trace:
      #0 D:\Workspace\Doctrine\Doctrine\Connection.php(1395): Doctrine_Transaction->commit(NULL)
      #1 D:\Workspace\Doctrine\Doctrine\Connection\UnitOfWork.php(143): Doctrine_Connection->commit()
      #2 D:\Workspace\Doctrine\Doctrine\Record.php(1748): Doctrine_Connection_UnitOfWork->saveGraph(Object(User), true)
      #3 D:\Workspace\test.php: Doctrine_Record->replace()
      #4

      {main}

      thrown in D:\Workspace\Doctrine\Doctrine\Transaction.php on line 265

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Jonathan H. Wage
            Reporter:
            p4l
          • Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated: