I'm using Drupal with flash and using Views 2 to generate a "sitemap" containing all of the nodes the Flash cares about, and I'm using Services to get that view Page via views.get (previously views.getView)

Fields included in this view include nid, node.title, node.path (now Node Link?) and so on, the important ones for me is node.id and the node's path (alias), because I use this to marry up a deep link to a node id.

The problem that is occurring is the view.get is not showing the Node Link field (a standard Node field in the Views editor).

Reproduce this issue like so:

1. Create a new View that includes fields for Node Id, Node Link, Node Title.
2. Give that view a Page e.g. "sitemap"
3. Load that view using Services view.get (via the service browse page) giving fields:"nid","title","type","path".
4. Notice the nodes' path fields are missing from the result, and another couple of extraneous fields are added.

It looks as though the fields are not being used?

p.s. Does anyone know why Node "path" is now node link in Views? Is that the same thing? I've downgraded to an older version of Services until I figure a way to fix this or it is fixed in the trunk.

CommentFileSizeAuthor
#3 views-service.patch659 bytesjody lynn

Comments

gonxalo’s picture

i think this is a Views Module problem.
if we select Node: Link (the path to the node) in the Views UI, it doesnt return, because is not int the query...

greg.harvey’s picture

I noticed this too, but actually I seem to be getting all other information about my node - just not the actual node any more. Doesn't actually affect me, as I intended to use the node.get method provided by the Node Service to get the full node data anyway, which is what I have done.

I'm not sure this is a problem or a mistake. It may be by design. No one from the Services team has come back to me as yet.

It could also be because the Views API changed, which would not be a problem with Views, but a problem with Services.

In any case, I circumnavigated this by using node.get, which should be totally future proof and is probably the intended approach to getting node data anyway. =)

jody lynn’s picture

Status: Active » Needs review
StatusFileSize
new659 bytes

This worked correctly in the older dev version which was using views.getView and did a node load of each node returned from the view. IMO it was a mistake to remove this bit of functionality since people really do need all the fields from the nodes when they ask for a view.

I switched it back to loading the nodes in my patch which solved the problem for me.

greg.harvey’s picture

Thanks Lynn. Hopefully you'll get some feedback from the maintainers. At the end of the day, it's their call as to whether views.get should return nodes from node views or if it should only show view data and oblige you to go and load any nodes surfaced by a view.

I can see the argument swinging both ways. I was initially annoyed the views.get method no longer presented a complete node object, but the more I think about it, the more I find it logical that it does not.

carvalhar’s picture

hi,

when i configure a view, i get the result as i want, but view service doesn't show all the fields i want, and even some fields that i didn't choose appears...

i tried the patch above but it didn't work, actually, it returned all node info...

any suggestion/prevision?

snelson’s picture

Assigned: Unassigned » snelson
Status: Needs review » Fixed

Committed to D6.

What it does now is check the row_style setting on the view. If it is "node", then a node_load will be performed. This should keep everyone happy.

As for non-database fields. I'm not sure what we can do here. I'd imagine a field like "node link" is more of display field than anything. I'd doubt there'd be any way to access the actual url of the node through this field.

beekerstudios’s picture

Does this mean we can now theme, build a drupal view and load all node data, just a themeified view. I am starting to think that Views is less and less what i need. It's a frontend, that doesn't require that you know any SQL, instead of a backend power tool.

I am trying to theme a view, I want the URL of each node, and CCK fields, and I want to lay them out the way I want to, including putting data within the CCK fields inside of a link, and to some very custom stuff. And the new Views 2 just does not allow it, the way the old Views module did.

I resorted to a simple MySQL/php snippet, but now I realize I want to theme the taxonomy views, so it looks like this custom php snippet. This would have been possible with the old views, but not anymore, it's so convoluded.

Sorry if my post is hijacking this thread, but, since ultimately I am trying to load the full node (raw data), it seems like this is VERY related to my problem/solution.

greg.harvey’s picture

You are hijacking a thread AND you're posting on completely the wrong project. This is the issue queue for the Services module. ;-)

As for Views 2 theming, it should be easier - everything is templated. If you have a specific issue, post in the Views issue queue. I find merlinofchaos a dilligent maintainter who always responds to reasonable support requests, so I'm sure he'll help you out, as long as you've read the advanced help before asking. There is a decent Views 2 theming section in there.

mllr’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

wouter99999’s picture

snelson, I tried with setting row_style to nodes and it worked! Nice, this one should go in the documentation.
Saves me a lot of time modifying the module although it would even better if I could do this with row_style set to fields, because then I would only receive the fields I would like.

For me it is also important because I want to load a list of nodes into Flex3 and than a user can click a node from the list to see details. One of the items in the details is a thumbnail image, generated with the imagecache module. Without receiving all fields specified in the view or complete nodes I would only get the fid of an image. Then I would need to: 1. do a view.get to receive the fid.
2. do a file.get, which gets me the path and complete content of original image (the latter I don't need).
3. do a http request to get the thumbnail (or create one from the original image in Flex.

So you see, now I can get at least the image url immediately in the view, that saves a lot of overhead.

mga’s picture

Wow this is what I was looking for! (#3)

AMFPHP was not receiving the whole shebang from my nodes (taxonomies, related nodes, a bunch of custom fields) and making the patch change now returns (almost) all my node data. The only thing missing would be ImageCache file paths but I parse them based on the original file path (since ImageCache uses the same filenames but different paths).

I am using Fields row style since Nodes won't output a thing (I use translation so the node is just the nid).

I had an issue in this URL:

http://drupal.org/node/678202

thommyboy’s picture

hi there, a question to the maintainers. if i get it right i do have three options at the moment
- use field style output but get only fields in the primary query
- use the patch to get fields
- use node style output to get the whole nodes
i am using relations, imagecached output of images (sometimes) attachments so all this would not be easy to access through the service? i can easily imagine it's not a simple thing to get all data together into one object as multiple modules might be affected but what are the plans/developments for the views-service? because i think quite a lot of people would expect/love ;) to just get all the fields they configured in the view...

dereckd’s picture

subscribe

newnewuser’s picture

subscribe

kylebrowning’s picture

Project: Services » Services Views
tanius’s picture

Issue summary: View changes

At least for the case where you want services_views to return JSON or XML output, I found a workaround to get all field-style output for all fields you configured in the view. I documented it in #678202-12: Views does not return taxonomy for Services.