When retrieving a view, only the native fields can be reached. If a non native field is added to the view, it replaces the nid of the current node, and is not added to the data result.
Steps to reproduce:
- Install services_views module and all its dependencies
- Create a rest server with permission to retrieve views
- Create a view referencing a content type, and add a custom field to the fields section.
- Retrieve the view using a http request.
The nid will be replaced by the content of the custom field in each node returned.
Comments
Comment #1
sunnyuff commentedIf you add global php field (views_php) to the view you wants to retrieve through services, it will return blank result.
Error Logs shows this error :
"Notice: Undefined property: stdClass::$views_php_8 in views_php_handler_field->render() (line 223 of /home/sunny/htdocs/sapis/sites/all/modules/contrib/views_php/plugins/views/views_php_handler_field.inc)."
Comment #2
yogeshchaugule8 commentedHi,
I was having same issue, when I've added a label to custom fields they've started coming in my services output.
Yogesh
Comment #3
arnaud.dabouis commentedI tested your solution and it works. Thanks.
Comment #4
kylebrowning commentedComment #5
internal commentedI reproduce this symptom with latest 1.1. The value of nid will be overwritten by the value of custom field, such as my_custom_title. The solution is to specify Custom value key in field configuration. If it's by design. It should be bold documented. Thanks.