Hi there:
When I create a new View based on a Node with the Upload: Attached files item, the information about the Uploaded files does not get returned to the Services module.
It does get returned in the "Preview" section of the View, but it appears to be missing from the original query (leading me to believe that the attachments information comes from a second query, invisible to the Services module.)
The query comes up as:
rray ( [query] => SELECT node.nid AS nid, node_revisions.body AS node_revisions_body, node_revisions.format AS node_revisions_format, node.created AS node_created, node.title AS node_title, node.changed AS node_changed, node.type AS node_type, node_data_field_website.field_website_url AS node_data_field_website_field_website_url, node_data_field_website.field_website_title AS node_data_field_website_field_website_title, node_data_field_website.field_website_attributes AS node_data_field_website_field_website_attributes, node_data_field_website.nid AS node_data_field_website_nid, node_counter.totalcount AS node_counter_totalcount, node.vid AS node_vid FROM {node} node LEFT JOIN {node_revisions} node_revisions ON node.vid = node_revisions.vid LEFT JOIN {content_field_website} node_data_field_website ON node.vid = node_data_field_website.vid LEFT JOIN {node_counter} node_counter ON node.nid = node_counter.nid WHERE (node.type in ('%s')) AND (node.status <> 0) ORDER BY node_created DESC [count_query] => SELECT node.nid AS nid FROM {node} node LEFT JOIN {node_revisions} node_revisions ON node.vid = node_revisions.vid LEFT JOIN {content_field_website} node_data_field_website ON node.vid = node_data_field_website.vid LEFT JOIN {node_counter} node_counter ON node.nid = node_counter.nid WHERE (node.type in ('%s')) AND (node.status <> 0) [query_args] => Array ( [0] => showcase_entry ) )
Notice that there are no references to "upload" or "files" in there.
When I preview that View, I get the following:
Body:
whiletrue® is a Swedish computer consultant firm located in Lund, Sweden.
Nid: 6156
Post date: Sep 18 2008 - 2:40am
Title: whiletrue.se - whiletrue®
Updated date: Sep 22 2008 - 7:36am
whiletrue.se - whiletrue®
Total views: 38
Attached files: "No files attached"
Notice the last item, Attached files.
When I run that through the Services/ module browser, I get:
[0] => stdClass Object
(
[nid] => 6156
[node_revisions_body] => whiletrue® is a Swedish computer consultant firm located in Lund, Sweden.
[node_revisions_format] => 1
[node_created] => 1221720043
[node_title] => whiletrue.se - whiletrue®
[node_changed] => 1222083393
[node_type] => showcase_entry
[node_data_field_website_field_website_url] => http://www.whiletrue.se/
[node_data_field_website_field_website_title] => whiletrue.se - whiletrue®
[node_data_field_website_field_website_attributes] => N;
[node_data_field_website_nid] => 6156
[node_counter_totalcount] => 38
[node_vid] => 6156
)
Everything but the upload information is included.
Mike
Comments
Comment #1
merlinofchaos commentedOk, I have no idea what services module does, but yes, that information comes from a second query.
Comment #2
merlinofchaos commentedIt's probable that services needs to call
$view->style_plugin->pre_render($view->result);to set up the extra queries.Comment #3
merlinofchaos commentedThat said, the extra data usually lives on the field handler objects and isn't put back into $result.
Comment #4
marcingy commentedWork on views 2 and better support in services is on going.