New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
If an Entity Reference field has no value, it isn't listed in a GET and gives an error on a PATCH #405
Comments
A similar problem: if a drupal field doesn't have a value then no process_callbacks run. |
Hi @BurningDog I'm just solving same thing, found some walkaround: Add viewEntity to your resource class:
I know for example if uid is 0 than there is FALSE in response, so just add new keys to publicFieldsInfo:
What do you think about this? |
Having this problem when do POST. It seems a problem with entity module though. global $user;
$values = array('type' => 'agreement');
$entity = entity_create('node', $values);
$wrapper = entity_metadata_wrapper('node', $entity);
$access = $wrapper->field_entity_ref->access('view', $user);
dvm($access); // this is always false |
I ran into this issue as well. I've created an issue on the entity module's queue and uploaded a patch which is working for me. |
I'm trying to update the value of a field in drupal with a PATCH request and getting the following error message:
Field current_course is an Entity Reference field which lists the groups a user belongs to. I have defined it in
function publicFieldsInfo()
as:When the field doesn't have a value and I perform a GET on the API endpoint,
current_course
doesn't show up at all in the returned JSON. I expect to see at least"current_course":null
However, once the field has a value, the PATCH request works as expected.
The text was updated successfully, but these errors were encountered: