What I'm using:
Drupal 6.11
Plugin version combos I've tried:
Services 6.x-0.13
Views 6.x-2.5
and
Services 6.x-1.x-dev
Views 6.x-2.x-dev
I've created a node type named Emoticon with a File field type of Image.
Inside the emoticon view, I specified a field which returns the "Path to file" of the emoticon.
When previewing the view inside the View editor the path field is displayed properly.
When calling this view from the Views.get form inside Services I get:
[node_data_field_chat_emoticon_field_chat_emoticon_fid] => 79
[node_data_field_chat_emoticon_field_chat_emoticon_list] => 1
[node_data_field_chat_emoticon_field_chat_emoticon_data] => a:3:{s:4:"crop";a:5:{s:1:"x";i:0;s:1:"y";i:0;s:5:"width";s:2:"59";s:6:"height";
s:2:"59";s:7:"changed";s:1:"1";}s:3:"alt";s:0:"";s:5:"title";s:0:"";}The odd thing is, when I execute the SQL which Devel displays for the view, it matches what the service module returns (no path).
Perhaps Views is doing an extra behind the scenes query on the 'fid' to get the path?
Here is the SQL query:
SELECT node.nid AS nid, node.title AS node_title, node_data_field_chat_message_group.field_chat_message_group_value AS node_data_field_chat_message_group_field_chat_message_group_value, node_data_field_chat_message_group.delta AS node_data_field_chat_message_group_delta, node.type AS node_type, node.vid AS node_vid, node_data_field_weight.field_weight_value AS node_data_field_weight_field_weight_value, node_data_field_chat_emoticon.field_chat_emoticon_fid AS node_data_field_chat_emoticon_field_chat_emoticon_fid, node_data_field_chat_emoticon.field_chat_emoticon_list AS node_data_field_chat_emoticon_field_chat_emoticon_list, node_data_field_chat_emoticon.field_chat_emoticon_data AS node_data_field_chat_emoticon_field_chat_emoticon_data FROM node node LEFT JOIN content_field_chat_message_group node_data_field_chat_message_group ON node.vid = node_data_field_chat_message_group.vid LEFT JOIN content_field_weight node_data_field_weight ON node.vid = node_data_field_weight.vid LEFT JOIN content_type_chat_emoticons node_data_field_chat_emoticon ON node.vid = node_data_field_chat_emoticon.vid WHERE node.type in ('chat_emoticons')Any suggestions will be greatly appreciated.
Thanks
Comments
I ran into the same issue
I ran into the same issue with a project that I'm working on at the moment. I worked around it by using a patch from Steven Merrill, where he created a views2-specific service, which has some additional support for filters and whatnot found in the current services module.
http://drupal.org/node/329048
Thank you!
The patch you referenced seems to only return the html the view generates, while the patch at http://drupal.org/node/300850 (referenced in the comments to the patch discussion you mentioned) does exactly what I needed. It displays the actual values of the node attributes as seen in the display as part of an object.
I hope this post will help others.
Thank you for you reply!
I ran into the same issue too !!!
Today I faced the same situation as tseven described above, tried many times but still cannot get it working, I used the patch mentioned at:
http://drupal.org/node/300850
http://drupal.org/node/329048
But still cannot get it work, maybe I'm not applying the patch correctly?
Versions:
Services : 6.x-0.13
Views: 6.x-2.3
Any help will be greatly appreciated.
Thanks
Andy
Andy, I had trouble applying
Andy,
I had trouble applying the patch normally as well. I manually copied and pasted the code it. It's not too difficult to see what's going on.
It's basically adding a new function named something like getactualview which hooks into services.
The 2nd patch you listed adds a plugin to the service module which outputs the raw html the view generates. I didn't have a need for that. I only needed the array of objects generated by the view.
I've also modified the first patch to extend the arguments it receives as well as a few other enhancements.
Contact me if you'd like a copy of the file.
I hope this helps.
Thanks for your message
Hi, Tseven,
Thanks for the quick replay, what i want is to get a data object by calling views.get() in Flash, I'm expecting flash can get a data object with the actual view data structure, but what i got is like:
a:3:{s:4:"crop";a:5:
In view edit page, I can get the output, but views.get() page not, so there must be sth not properly handled in services' view module.
Could you just send me your copy of services code?
Thanks
Andy
Sure thing, I'll try to
Sure thing, I'll try to remember to do that tomorrow.
The patch will allow you the print out the pat of the file. I'm not sure if it will do exactly what you want though.
Do you want to pass it as JSON object?
No, Just a common AMFPHP data object
Thanks Tseven, I'm expecting your file to generate the "miracle", hopefully :).
Run into the same problem!
I'm having exactly the same problem. I'm using Views 6.x-2.12 and Services 6.x-2.4.
Did you manage to get the right output from services?