Joe,
I wasn't saying to remove all validation, but to add the method that allows you to not specify a value for the field.
->allowEmpty('name','update')
->allowEmpty('requires_value','update')
->allowEmpty('acttive','update')
If you add these lines to your validation, it should fix the problem allowing you to patch the entity specifying only the Id for the attribute and allowing cake to properly add the join data so as to save the listingsAttributes.
This will retain the validation for adding and editing attributes but allow you to not specify every field when updating.
That is what I was trying to get across in my previous post...
On Friday, March 6, 2015 at 3:08:28 AM UTC+7, Joe T. wrote:
-- I wasn't saying to remove all validation, but to add the method that allows you to not specify a value for the field.
->allowEmpty('name','update')
->allowEmpty('requires_value','update')
->allowEmpty('acttive','update')
If you add these lines to your validation, it should fix the problem allowing you to patch the entity specifying only the Id for the attribute and allowing cake to properly add the join data so as to save the listingsAttributes.
This will retain the validation for adding and editing attributes but allow you to not specify every field when updating.
That is what I was trying to get across in my previous post...
On Friday, March 6, 2015 at 3:08:28 AM UTC+7, Joe T. wrote:
Kevin,
i can do that, but it doesn't make sense to me. i don't want my Listing to make any changes to the Attributes, so why is it attempting to do so? If i disable validation for updates, they won't be validated when the admin actually DOES edit an Attribute.
Maybe a full end-to-end association isn't what i want here?
If i want my data save to stop at ListingsAttributes, what would that look like in the form & Controller? Is it even possible? i made a couple half-hearted attempts at it, but didn't get anywhere.
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment