Hello,

I'm trying to build flash news with text and image, using CCK, Views, Services, AMFPHP and Drupalsite classes in a simple Flash AS3 document.

I succeed to connect and get view datas in my Flash document. The same datas I get when I call the views.get method in the Services Browser :

Array
(
    [0] => stdClass Object
        (
            [nid] => 24
            [node_data_field_news2_image_field_news2_image_fid] => 26
            [node_data_field_news2_image_field_news2_image_list] => 1
            [node_data_field_news2_image_field_news2_image_data] => a:1:{s:11:"description";s:0:"";}
            [node_data_field_news2_image_nid] => 24
            [node_type] => news2
        )

    [1] => stdClass Object
        (
            [nid] => 25
            [node_data_field_news2_image_field_news2_image_fid] => 27
            [node_data_field_news2_image_field_news2_image_list] => 1
            [node_data_field_news2_image_field_news2_image_data] => a:1:{s:11:"description";s:0:"";}
            [node_data_field_news2_image_nid] => 25
            [node_type] => news2
        )

)

But the last problem I hit against is simply to get the file name and path.
I'm sure it might be simple when you have the fid, but I cant' get through for few days.

Thanks in advance

Redmu

Comments

gdoteof’s picture

Priority: Normal » Critical

did this ever get figured out?

I am stuck on exactly the same thing

gdoteof’s picture

Status: Active » Fixed

this is solved in dev. make sure your views row format is 'node' and not 'fields'

drupal.call("views.get",new Responder( onViewGet, onError ),sessionId, viewName, new Array("field_headline_image") );

//then access it just like php

function onViewGet( _view:Object ) {
 //do rad shit
for(var i in _view){
_view[i]['field_headline_image'][0]['filepath'];
}
}

Status: Fixed » Closed (fixed)

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

ventoline’s picture

Iam a newby in PHP and using drupal..
So, I have a very basic problem getting the data from a view.get call; i'm connecting but how to get down the array to extract the data?

Here is my code so far:

function onConnectMenu(_menu:Object)
	{ 	trace("conncted to menu"); // outputs connected
		trace(._menu[0].node_type); // doesn't work
                ...

Thank you

merrick.christensen’s picture

Still having issues with this problem. I'm not sure where to put the function above. I am using drupal 6. Thanks a ton.

mga’s picture

Hi

I am at a loss with this:

If I use the "fields" row style, I get all the data I need in from the service except the photo. Similar to this problem (comment #59): http://drupal.org/node/329048#comment-1766626

If, as recommended, I change the style to "node" I get no data similar to: http://drupal.org/node/508388 and in this mode I cannot set fields so I am not sure what comment #2 in that post is talking about.

I am also using ImageCache.

Any help will be appreciated.

mcfilms’s picture

Assigned: redmu » Unassigned
Category: support » bug
Status: Closed (fixed) » Needs work

Hi MGA -- join the club. It appears that Services views.get is badly broken. I had views.get working briefly under a previous version of the Services 6.x-2.x-dev. But it is broken again in the 12-25-2009 version. This is true even when you use a views row format of 'node' and not 'fields'

Also, views.get was not working for me in the 6.x-0.15 release. It seems it is impossible to get text from cck fields and image locations via this method at the moment. I have decided to use XML data document for my project.

carlosg2’s picture

My solutions to fix this

Imagefield cck path with views
http://drupal.org/node/585812#comment-2076132

Imagecache service:
http://groups.drupal.org/node/21248

Best regards
Carlos

mga’s picture

@mcfilms that sucks. I ended up parsing the file URL and from here re-constructing the ImageCache URL (since ImageCache uses the same filename as File but in different folders).

This kind of solves it for me as far as images are concerned but I still cannot get the taxonomy/tags data for the node. Any ideas on this?

voxpelli’s picture

Version: 6.x-0.13 » 6.x-2.x-dev
Priority: Critical » Normal
Status: Needs work » Closed (duplicate)

This is kind of a duplicate of #654644: views.get method changed in DEV version - the Views Service is currently, partly due to lack of functionality in Views itself, returning the raw result of the database queries Views makes.

#654644: views.get method changed in DEV version suggests re-adding a specific workaround for the node row style which would run every row through node_load() and as such have all fields correctly populated.

Edit: Just a note - I know it can be frustrating to have an issue marked as a duplicate - I ensure you that I do this to have this issue resolved faster since it will make the discussion more focused.