Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 1.2.0-RC1
-
Fix Version/s: 1.2.0
-
Component/s: None
-
Labels:None
Description
If there is a model named before "Base" (in the alpabetical order), like "Address", Doctrine::loadModels() returns an incorrect array by including the BaseAddress class :
Array
(
[Address] => Address
[BaseAddress] => BaseAddress
)
This happens because in the list of files, Address.class.php (where Address extends BaseAddress) comes before BaseAddress.class.php. So BaseAddress is already loaded when loadModels() checks if the BaseAddress class exists. Then this class is added in the loaded models without check if this is a valid model class.
This can be easily fixed :
// Doctrine/Core.php , line 679: // replace : $loadedModels[$className] = $className; // by : if (self::isValidModelClass($className)) { $loadedModels[$className] = $className; }
Thanks for the ticket and fix.