Open 123andy opened 2 years ago
Related -- is there a better way to handle this kind of an error? When I I do:
$entity = $factory->create('my_object', $payload);
If I get a 'false' back, I know it failed for some reason but I'm not sure how I could get the list of $errors
from the entity object?
In
validateProperty
we take a pretty strict definition (by php standards) for the columns defined as 'text'. A php number will be rejected. In my case, I had an array key that was numeric (for one record_id) and when I tried to save it into an entity defined as a 'text' field (as some other records are alpha) - it failed.I had to explicitly cast it as a string in the payload to the entity before trying to create the new record. One might consider allowing numeric integers as well to be more 'REDCap-like'...
Or, am I missing something here...