Changeset 5311

Show
Ignore:
Timestamp:
12/18/08 02:09:37 (7 months ago)
Author:
jwage
Message:

[1.1] Fixed infinite loop problem with isValid() (closes #1750)

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/1.1/lib/Doctrine/Record.php

    r5301 r5311  
    326326            return true; 
    327327        } 
     328 
     329        if ($this->_state == self::STATE_LOCKED || $this->_state == self::STATE_TLOCKED) { 
     330            return true; 
     331        } 
     332 
    328333        // Clear the stack from any previous errors. 
    329334        $this->getErrorStack()->clear(); 
     
    351356        $valid = $this->getErrorStack()->count() == 0 ? true : false; 
    352357        if ($valid) { 
     358            $stateBeforeLock = $this->_state; 
     359            $this->_state = $this->exists() ? self::STATE_LOCKED : self::STATE_TLOCKED; 
     360 
    353361            foreach ($this->_references as $reference) { 
    354362                if ($reference instanceof Doctrine_Record) { 
     
    364372                } 
    365373            } 
    366         } 
     374            $this->_state = $stateBeforeLock; 
     375        } 
     376 
    367377        return $valid; 
    368378    }