I'm having a problem with $persistModel = true.
I have two models: Subproduct hasMany Unavailability, and
Unavailability belongsTo Subproduct.
After a first request to /subproducts/search/ with an (intentionally)
invalid parameter for 'from_date' in the search form, cake creates the
Subproduct model object cache file, and displays the error correctly
under the 'from_date' field in the search form.
For all subsequent requests, no more errors show up under the
'from_date' field on the form when invalid data is entered.
If I delete the cached model object file, errors show up again, but
only for the first time because as soon as cake creates the cached
object model file, the errors no longer show up.
Note: there is only a cached model file created for Subproduct, but
not for Unavailability.
I narrowed down the problem to the following: when the code returns
from the invalidate() function, the validationErrors array is being
reset to null.
Here is my call to the invalidate function. I call it from the
subproducts controller:
$this->Subproduct->Unavailability->invalidate('from_date');
Within the invalidate function, $this->validationErrors['from_date'] =
1. As soon as the function returns, $this->validationErrors = null.
Any suggestions ?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---