Upgrading to version 1.0 II

Published on and tagged with cakephp  problem  tip

Well, I could identify one cause for the problems I encountered after upgrading to version 1.0 of CakePHP. It is a bugfix in CakePHP which breaks my code ;-)

This bugfix adds for associated models without data an empty array to the results array when you do a find. But in my code I checked for the existence of the associated models in the results array and expected that only one of the associated models is in the results array (I have an inheritance structure, Role hasOne ConcreteRole, and so only one ConcreteRole is allowed to contain data for a particular Role).

Bake a comment




(for code please use <code>...</code> [no escaping necessary])

© daniel hofstetter. Licensed under a Creative Commons License