Closed (cannot reproduce)
Project:
Services
Version:
7.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
27 Jun 2012 at 16:41 UTC
Updated:
9 Oct 2012 at 18:20 UTC
After updating to the latest dev version this morning I am getting the warnings below. I think I was getting these earlier, but I either patched or they went away on their own. Any idea how to fix?
When I trying to debug (e.g. dpm($resource, '_services_process_resource $resource');) almost all results are arrays, except I am seeing two places (one for each _services_process_resource and _services_apply_endpoint) that show a value of 3002 (e.g. _services_apply_endpoint $resource => 3002 from the dpm output). Not sure where that is coming from. I only have two custom resources enabled and they only retrieve 'methods' -- resources are pasted below the warning output.
Warning: Cannot use a scalar value as an array in _services_process_resource() (line 152 of /Users/rkoberg/Sites/pfcc/www/sites/all/modules/services/services.resource_build.inc).
Warning: Cannot use a scalar value as an array in _services_apply_endpoint() (line 101 of /Users/rkoberg/Sites/pfcc/www/sites/all/modules/services/services.resource_build.inc).
Warning: Invalid argument supplied for foreach() in services_edit_form_endpoint_resources() (line 286 of /Users/rkoberg/Sites/pfcc/www/sites/all/modules/services/plugins/export_ui/services_ctools_export_ui.class.php).
function pfcc_lesson_services_resources() {
$node_resource = array(
'lesson' => array(
'retrieve' => array(
'callback' => '_pfcc_services_node_resource_retrieve',
'args' => array(
array(
'name' => 'nid',
'optional' => FALSE,
'source' => array('path' => 0),
'type' => 'int',
'description' => 'The nid of the node to get',
),
),
'access callback' => '_node_resource_access',
'access callback file' => array('type' => 'inc', 'module' => 'services', 'name' => 'resources/node_resource'),
'access arguments' => array('view'),
'access arguments append' => TRUE,
),
),
);
return $node_resource;
}
function pfcc_standalone_article_services_resources() {
$node_resource = array(
'standalone_article' => array(
'retrieve' => array(
//'file' => array('type' => 'inc', 'module' => 'services', 'name' => 'resources/node_resource'),
'callback' => '_pfcc_services_node_resource_retrieve',
'args' => array(
array(
'name' => 'nid',
'optional' => FALSE,
'source' => array('path' => 0),
'type' => 'int',
'description' => 'The nid of the node to get',
),
),
'access callback' => '_node_resource_access',
'access callback file' => array('type' => 'inc', 'module' => 'services', 'name' => 'resources/node_resource'),
'access arguments' => array('view'),
'access arguments append' => TRUE,
),
),
);
return $node_resource;
}
Comments
Comment #1
ygerasimov commentedCould you please resave your endpoint settings and advise whether this problem still persist. Also please advise when do you have these warnings? Is it on save of the endpoint or the call?
Comment #2
RobKoberg commentedI am not getting the error on a clean install, so it must be something on my end...
It occurs on view of the 'Edit Resources' for an endpoint, e.g.: /admin/structure/services/list/base_services/resources
On save of that page, I get several more warnings:
Comment #3
kylebrowning commentedDo you mind exporting your endpoint so I can import it?
Comment #4
RobKoberg commentedHere you go:
Comment #5
kylebrowning commentedthat looks fine, what about standalone article and lesson definitions. Can I see those?
Comment #6
zengenuity commentedI got this same message when I had the UUID Services module enabled. Disabling the module fixed the issue. I'm not sure if that's the same problem as the original poster had, but posting it for others.
Comment #7
kylebrowning commentedI still cannot reproduce this. Can someone provide some steps to do so?