While previewing a services display, the values of custom fields in the array output is inappropriate. It displays the node id value instead of the actual value of the field. See attached screenshot.

This is not the case with predefined fields like title, body, published date, etc. It's a critical issue as it makes it difficult to preview the view you are developing.

CommentFileSizeAuthor
drupal_services_views_preview_bug.png236.42 KBdayson
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ygerasimov’s picture

Status: Active » Fixed

You are completely right. I have implemented displaying output same was as it is handled by services. So now preview should work better.

Please test and reopen this issue if you still have any problems.

RogerRogers’s picture

Status: Fixed » Active

I just tested for both dev and beta versions and this is still a problem. I setup a service view and try to add a description field but the output title is 'nid' and value is the nid.

ygerasimov’s picture

Priority: Major » Normal

@RogerRogers please advise the type of the description field. Also what formatter do you use in your Services display?

grasmash’s picture

I'm also experiencing this issue with many field types, including: taxonomy terms, body field, phone, addressfield, etc.

It looks like the Views query is wrong:

SELECT node.title AS node_title, node.nid AS nid, 'node' AS field_data_field_phone_primary_node_entity_type, 'node' AS field_data_field_services_node_entity_type, 'node' AS field_data_field_address_node_entity_type, 'node' AS field_data_body_node_entity_type
FROM ...

The non-working fields are simply selected as 'node' rather than node.field_name.

grasmash’s picture

This actually appears to be fixed in the latest dev.

mototribe’s picture

the dev version fixed this problem for me as well. Thanks!

ygerasimov’s picture

Status: Active » Fixed
mototribe’s picture

Status: Fixed » Active

I came across another bug with the dev version that seems to confirm the original issue:
when I set a "custom value key" and the value starts with a lowercase character it will just show the nid value in the output.
When I change it to start in uppercase it works correctly. Took me lots of trial and error to find that one ;-)

I also noticed that when you add the field "Comment Count" it always uses the value key "node_comment_statistics_comment_count", even when it's set manually.

Cheers

ygerasimov’s picture

Status: Active » Postponed (maintainer needs more info)

@mototribe can you advise what field, what formatter you get this problem? I am trying to reproduce the situation with node's body field but everything works fine.

mototribe’s picture

I have a field "model_id" added to a vocabulary.
When I create a view of to show "term tid" and "model_id" it will show the tid value instead of the model_id.
When I change the label to "Model_id" it will show the correct value.

skyredwang’s picture

Priority: Normal » Major
Status: Postponed (maintainer needs more info) » Active

Confirmed this bug with Content: All taxonomy terms (terms)
If the custom value key is set to "terms", then the output is the value of nid.
If no custom value key, then the label of the "All taxonomy terms (terms)" is called "nid", and the value is nid as well

eliasdc’s picture

I can confirm that with the latest 7.x-1.x-dev the preview works for services views, except for field Content: All taxonomy terms (terms).

When using "Content: All taxonomy terms (terms)" with a lower case custom value key the label is correct in preview and the service. But the value is still the nid of the node in the request and in preview. I would like to have a comma separated simple list of all taxonomy terms (custom text is not working in services display).

matt2000’s picture

This bit me today, and the dev release fixed it. Can we get a new beta release?

jbeuckm’s picture

Same as what matt2000 said in #13. 5/13/13 + 8/13/13 = 13/13/13! new beta?

kylebrowning’s picture

Issue summary: View changes
Status: Active » Closed (fixed)