Uploaded image for project: 'Doctrine 1'
  1. Doctrine 1
  2. DC-989

Doctrine_Connection::execute() and Doctrine_Connection::exec() fail if Doctrine_Event::skipOperation() is triggered


    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 1.2.3
    • Fix Version/s: None
    • Component/s: Connection
    • Labels:


      In order to generate SQL from migrations, an event listener was attached to the migration system to monitor for preQuery and preExec events.

      In an attempt to prevent the migration from additionally writing the query to the database, the skipOperation method was triggered, and supposedly allowed for n the execute() and exec() methods of Doctrine_Connection

      eg. Doctrine_Connection::execute()
      if ( ! $event->skipOperation) {
          $stmt = $this->dbh->query($query);

      unfortunately setting this option in the event listener breaks execution of the migration system as the $count/$stmtn variables (used in the methods) are no longer defined, triggering E_NOTICE, and the fetch* methods (eg fetchColumn) also break as they are chaining methods without testing for the return. theerfore, even if the $stmnt variable was created as initially null, the system would still throw an E_FATAL as the NULL variable doest provide the ::fetchColumn() methods (etc).

      Quite a serious flaw as 2 areas of code do not provide a consistent approach to how to work with events.


        There are no comments yet on this issue.


          • Assignee:
            jwage Jonathan H. Wage
            temperedvision David Dixon
          • Votes:
            0 Vote for this issue
            0 Start watching this issue


            • Created: