No permission for views_service module

Events happening in the community are now at Drupal community events on www.drupal.org.
bstoppel's picture

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?

pdjohnson's picture

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?

bstoppel's picture

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

Everything else works but this...

bstoppel's picture

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()

bstoppel's picture

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?

bstoppel's picture

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

Have you tried this patch

amitaibu's picture

Have you tried this patch http://drupal.org/node/329048#comment-1677800 ?

Patch doesn't solve this problem

bstoppel's picture

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

amitaibu's picture

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

bstoppel's picture

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

amitaibu's picture

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:

Hot content this week