RESTful-Drupal / restful

RESTful best practices for Drupal
https://drupal.org/project/restful
419 stars 173 forks source link

Bug: Entity Reference field referencing unpublished node #683

Open lukewertz opened 9 years ago

lukewertz commented 9 years ago

When an entityreference field has a cardinality of 1 and is referencing a node that is unpublished, the result from RESTful is that the entity simply disappears from the return. I would expect to get back a null value, not that the property would disappear.

e0ipso commented 9 years ago

I agree with that. It seems that NULL values are an edge case that is not very well handled.

lukewertz commented 9 years ago

Actually, I think this bug report might be a duplicate of https://github.com/RESTful-Drupal/restful/issues/492

If I'm able to this week, I'll try pulling and testing it... and perhaps adding a test for it as well.

amitaibu commented 9 years ago

Yeah, we should probably check not only isset, but also array_key_exists - to better distinguish null from non existing