Closed (outdated)
Project:
Services Views
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
24 May 2013 at 00:37 UTC
Updated:
16 Aug 2018 at 02:47 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
ideafarm commentedI am getting the same behavior
Comment #2
fiosca commentedSame for me! Does anybody have a solution to this bug?
Comment #3
dmizrahi commentedPersonnaly with the dev version, it shows me the tid of each term when using the row format.
[{"taxo":[{"tid":"11"},{"tid":"10"},{"tid":"12"}],"title":"nouveau contenu"}]But with plain text format, each term is repeated :
[{"taxo":["Attente, Presentation, Theatre","Attente, Presentation, Theatre","Attente, Presentation, Theatre"],"title":"nouveau contenu"}]I don't know if it is related.
I'm using Views-7.x-3.7 with Services-7.x-3.5
Comment #4
bessone commented+1
Comment #5
pippopeppe commentedsame here!
Comment #6
tanius commentedShort info for those who, like me, struggled to understand what "rendering as services raw" is: for some fields that you add to your view, there will be a "Formatter: Services raw" option in the field settings. For example for taxonomy terms, node body fields and other HTML input fields. It is not there for all fields, also not for all multi-value fields (the "User: Roles" field does not have it for example).
To render a field with multiple values via services_views into JSON or XML when "Formatter: Services raw" is not available for it, a workaround might be #678202-12: Views does not return taxonomy for Services. In the services_views documentation video however, they use a "Global: PHP" field from views_php for the purpose of rendering a tags multi-value field [source].
Comment #7
ben.kyriakou commentedI've experienced a similar issue to #3 with multi-valued fields recently - instead of rendering as Services Raw I wanted to render as Plain Text or similar but have separate values. I tracked down the problem to the services_views resource - when rendering multi-value fields it does a pass for each value, but since it concatenates all the values it results in this duplication.
I've put in a quick patch that will convert output of the form;
To something in the form;
The patch creates a copy of the current row and removes all other values in the multi-value field apart from the one currently being processed, then passes it to the theming function as normal. Not the most elegant, but it works for my use-case.
Comment #8
ben.kyriakou commentedKicking off testing for the patch.
Comment #9
kylebrowning commentedNeeds a new re-roll!
Comment #10
pakmanlhI was able to show multiple term reference field values as soon as I removed all the style settings inside the field views configuration.
So I think that means this issue is gone.