Active
Project:
Services Entity API
Version:
7.x-2.x-dev
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
8 Mar 2014 at 08:16 UTC
Updated:
30 Apr 2014 at 05:45 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
joachim commentedHaving done some investigating -- it turns out this was never having an effect in my project's codebase due to a bug in OG! -- we definitely should be doing this, and it's a bug that we're not.
Comment #2
joachim commentedComment #3
wodenx commentedI agree with this in principle. I'd actually assumed that this was handled on the entity api level (for the "clean" or "metadata" controllers) - but recently discovered it is not.
I wonder, though, if we can make it possible to disable this check (a protected $validate_fields property on the controller?), as I'm a little concerned about what this might do to my app clients...
Comment #4
joachim commentedYeah, I'd be fine with a property on the controller to act as a bypass flag.
I'd assumed it was just handled when you saved an entity and the fields saved... but no, you can save any old crap into fields if you just use entity_save(), and it's only if the database schema doesn't tolerate it that you get an error.
Comment #5
joachim commentedProbably postponed until #2217129: OgBehaviorHandler::validate() fails to register errors correctly, and should not assume there's a widget is fixed, as we'd get errors from OG :(
Comment #6
joachim commentedComment #7
neubreed commentedI can confirm after applying the patch that validation is now working when posting entities via services_entity.
Although the message that comes back is generic and nondescript:
"Invalid data for entity in the following fields: field_last_name."
So I've installed field_validation module to customise the messages but this doesn't appear to be compatible. It only works if I check "Set errors using field API" But the message still comes back generic.
Would this be a new issue for field_validation or services_entity?