I created a custom service with mymodule_services_resources and I'm calling a function to return some items. This function inside is calling a view with views_get_view. The problem is always return an empty array.
If tested the same code somewhere else it shows the right results, but it does not work with services. I have something like this:
$view = views_get_view('the_view'); $view->set_display('default'); $args = array("my_param"); $view->set_arguments($args); $view->pre_execute(); $view->execute(); $view->result; //empty array in the WS
I tried loading the admin user ($user = user_load(1); ) before calling the view but I had the same results.
Is there something I should add, change or remove in order I can get the results of a view calling service endpoint?