Details
-
Improvement
-
Resolution: Fixed
-
Major
-
COmanage Registry 0.6 (Helpful Hexagon)
-
None
Description
AppModel::validateExtendedType needs to know the current CO ID in order to figure out which types are valid. However, $cur_co is attached to the Controller, not the Model.
The correct way to handle this would be to use CakePHP 2.2's dynamic validation rules
http://book.cakephp.org/2.0/en/models/data-validation.html#dynamically-change-validation-rules
to attach a suitable rule to the model, possibly in AppController. Currently, AppController::beforeFilter explicitly passes the CO ID to the Identifier model (the only model that currently supports Extended Types).