No permission for views_service module

Events happening in the community are now at Drupal community events on www.drupal.org.
Posted by bstoppel on June 22, 2009 at 8:06pm

I encountered another problem that I am assuming has to do with the lack of permissions for views_service.

First, my setup is completely up-to-date.

The problem is that from Flash on my desktop Services doesn't return any results from Views, ie the returned object is blank. When I change to a get a node, it works. The returned object contains all the pertinent information.

The strange thing is that under user permissions there is no mention of permissions for "views_service module." I am thinking the problem is that I cannot allow an "anonymous user" the option to "load any views data."

Any ideas as to what to do?

BTW - here is the code that I am using (save for appropriately commenting and uncommenting myService.call, and changes to the url and view name.)

package
{
import flash.display.MovieClip
import flash.net.NetConnection;
import flash.net.ObjectEncoding;
import flash.net.Responder;

public class mainPromo extends MovieClip
{
private var myService:NetConnection;
private var myServiceURL:String;
private var connectResponder:Responder;
private var viewResponder:Responder;
private var sessionID:String;
/
* Contructor
*/
public function mainPromo()
{
trace("in mainPromo");
myService = new NetConnection();
myService.objectEncoding = flash.net.ObjectEncoding.AMF3;
myServiceURL = "URL TO AMFPHP";

connectResponder = new Responder(getSessID, onError);

myService.connect(myServiceURL);
myService.call('system.connect', connectResponder);
}
/

* getSessID
*/
private function getSessID(returnObject:*)
{
trace("in getSessID " + returnObject.sessid);
viewResponder = new Responder(getViewInfo, onError);
sessionID = returnObject.sessid;

myService.call('views.get', viewResponder, sessionID, 'VIEW NAME');
// myService.call('node.get', viewResponder, sessionID, NODEID);
}
/
* getViewInfo
/
private function getViewInfo(returnObject:
)
{
trace("in getViewInfo " + returnObject);

for (var item:* in returnObject) {
trace(item + ": " + returnObject[item]);
}
}
/

* onError
*/
private function onError(f:*)
{
trace("Error" + f);
for (var item:* in f)
{
trace(item + ": " + f[item]);
}
}
}
}

Comments

Similar Issue?

Posted by pdjohnson on June 23, 2009 at 11:00am

Hi,

i am trying to work with the views service and get access denied even when I try executing the request from Drupal Admin. I have every permission granted for the user role so to remove any question of access privileges and am logged in as user 1.

I have Use Keys and use sessionID selected. The service works if I turn this off.

Does anyone have any idea how to make requests to this service?

Paul Johnson

http://www.twitter.com/pdjohnson
Global Social Media Lead for DrupalCon

Patched?

Posted by bstoppel on June 23, 2009 at 2:44pm

Is your setup fully patched? I had a similar issue as reported here http://groups.drupal.org/node/22706.

Everything else works but this...

Posted by bstoppel on June 24, 2009 at 9:04pm

I've tried other services like user.login and it works. Views.get even works from within Drupal just not from Flash. Can anyone provide some insight?

function views_service_get()

Posted by bstoppel on June 24, 2009 at 9:58pm

I dove into the function views_service_get() to see if I could figure out what is going on. My findings so far are that the view itself is being called, but the property $view->result is empty when called from Flash. It is correct when called from within Drupal.

Anyone?

Posted by bstoppel on June 25, 2009 at 6:30pm

Has anyone successfully used Views2 with Services1? I am starting to believe that it is currently not possible.

Have you tried this patch

Posted by amitaibu on June 25, 2009 at 6:53pm

Patch doesn't solve this problem

Posted by bstoppel on June 25, 2009 at 7:21pm

I hadn't tried that patch. It doesn't solve my problem. I get an empty div tag with this patch in place.

<div class="view view-nhm-main-page-promo view-id-nhm_main_page_promo view-display-id-default view-dom-id-1"></div>

Thanks for the thought though. I appreciate it.

You applied the patch - and

Posted by amitaibu on June 25, 2009 at 7:25pm

You applied the patch - and set $format_output = TRUE? With the above patch only when $format_output is TRUE you should get your HTML, otherwise you should get the $view->result as an array.

Have you tried it on a different clean drupal installation?

[Solved] Clean install

Posted by bstoppel on June 26, 2009 at 3:43pm

It turns out that something is awry with my original Drupal install. I started a clean install and this appears to be working.

Cool. Have you apllied the

Posted by amitaibu on June 26, 2009 at 3:51pm

Cool. Have you apllied the above patch?

Services

Group organizers

Group categories

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

AltStyle によって変換されたページ (->オリジナル) /