Changeset 5071

Show
Ignore:
Timestamp:
10/11/08 15:12:14 (18 months ago)
Author:
guilhermeblanco
Message:

fixes #1530. Thanks a lot for your help to address the ticket!

Location:
branches
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • branches/1.0/lib/Doctrine/Query/Abstract.php

    r5056 r5071  
    692692            $i    = ((int) substr($oldAlias, 1)); 
    693693 
    694             if ($i == 0) { 
    695                 $i = 1; 
     694            // Fix #1530: It was reaching unexistent seeds index 
     695            if ( ! isset($this->_tableAliasSeeds[$name])) { 
     696                $this->_tableAliasSeeds[$name] = 1; 
    696697            } 
    697698 
    698             $newIndex  = ($this->_tableAliasSeeds[$name] + $i); 
     699            $newIndex  = ($this->_tableAliasSeeds[$name] + (($i == 0) ? 1 : $i)); 
    699700 
    700701            return $name . $newIndex; 
  • branches/1.1/lib/Doctrine/Query/Abstract.php

    r5056 r5071  
    751751            $i    = ((int) substr($oldAlias, 1)); 
    752752 
    753             if ($i == 0) { 
    754                 $i = 1; 
     753            // Fix #1530: It was reaching unexistent seeds index 
     754            if ( ! isset($this->_tableAliasSeeds[$name])) { 
     755                $this->_tableAliasSeeds[$name] = 1; 
    755756            } 
    756757 
    757             $newIndex  = ($this->_tableAliasSeeds[$name] + $i); 
     758            $newIndex  = ($this->_tableAliasSeeds[$name] + (($i == 0) ? 1 : $i)); 
    758759 
    759760            return $name . $newIndex;