Open iStryker opened 9 years ago
I don't hold a big preference in this matter. Maybe @nathanv can share some documentation to point to best practises in this case.
Thanks for pointing this out!
I think it is probably a best practice because as a consumer of the service, it is preferable to not have to always check for the existence of a field before using/checking it's value.
Good!
Care to provide a PR? :-)
I just created a PR for this. checkPropertyAccess() returns false for fields with no data (in addition to those which the user doesn't have permission to access), so now it just populates the value with the default NULL for either case.
Tested this with Entity Reference field and it works!
In cas anyone stumbles on this, here is the PR mentioned by @krisgraham: https://github.com/RESTful-Drupal/restful/pull/505
Currently empty public field values are not getting outputted to the api. After speaking with @nathanv, he said it is best practice for all of them to return NULL. Should we be using this best practice?