Closed (fixed)
Project:
AMFPHP
Version:
6.x-1.0-beta1
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
9 Apr 2009 at 10:14 UTC
Updated:
27 Mar 2010 at 23:50 UTC
Whenever i try and get a view/node/search etc and get a services_error, I get the php error below. For instance, trying to get a view that doesn't exist, or search for a term with no results.
heres the error in full for an unsuccessful search:
[08-Apr-2009 17:49:19] PHP Fatal error: Uncaught exception 'VerboseException' with message 'Search returned no results.' in /Users/alistairmcclymont/Sites/j6/sites/all/modules/amfphp/amfphp.module:106
Stack trace:
#0 [internal function]: amfErrorHandler(256, 'Search returned...', '/Users/alistair...', 106, Array)
#1 /Users/alistairmcclymont/Sites/j6/sites/all/modules/amfphp/amfphp.module(106): trigger_error('Search returned...', 256)
#2 [internal function]: amfphp_server_error('Search returned...')
#3 /Users/alistairmcclymont/Sites/j6/includes/module.inc(450): call_user_func_array('amfphp_server_e...', Array)
#4 /Users/alistairmcclymont/Sites/j6/sites/all/modules/services/services.module(237): module_invoke('amfphp', 'server_error', 'Search returned...')
#5 /Users/alistairmcclymont/Sites/j6/sites/all/modules/services/services/search_service/search_service.inc(33): services_error('Search returned...')
#6 [internal function]: search_service_nodes('art', true)
#7 /Users/alistairmcclymont/Sites/j6/sites/all/modules/services/services.module(339): call_u in /Users/alistairmcclymont/Sites/j6/sites/all/modules/amfphp/amfphp.module on line 106
heres the error for trying to get a view that doesn't exist:
[09-Apr-2009 10:48:49] PHP Fatal error: Uncaught exception 'VerboseException' with message 'Access denied.' in /Users/alistairmcclymont/Sites/j6/sites/all/modules/amfphp/amfphp.module:106
Stack trace:
#0 [internal function]: amfErrorHandler(256, 'Access denied.', '/Users/alistair...', 106, Array)
#1 /Users/alistairmcclymont/Sites/j6/sites/all/modules/amfphp/amfphp.module(106): trigger_error('Access denied.', 256)
#2 [internal function]: amfphp_server_error('Access denied.')
#3 /Users/alistairmcclymont/Sites/j6/includes/module.inc(450): call_user_func_array('amfphp_server_e...', Array)
#4 /Users/alistairmcclymont/Sites/j6/sites/all/modules/services/services.module(237): module_invoke('amfphp', 'server_error', 'Access denied.')
#5 /Users/alistairmcclymont/Sites/j6/sites/all/modules/services/services.module(329): services_error('Access denied.')
#6 /Users/alistairmcclymont/Sites/j6/sites/all/modules/amfphp/amfphp.module(72): services_method_call('views.get', Array)
#7 /Users/alistairmcclymont/Sites/j6/sites/all/modules/amfphp/overrides/php5Executive.p in /Users/alistairmcclymont/Sites/j6/sites/all/modules/amfphp/amfphp.module on line 106
Is the amfphp module handling service errors correctly?
For clarity here's the code in search_service.inc in services module that is partially included in the stack trace:
// this is at the end of the search_service_nodes and search_service_users function, the above example looks at the node search
return services_error(t('Search returned no results.'));
The views_service.inc has this error that should be returned - but its returning 'access denied' instead
return services_error('View does not exist.');
Comments
Comment #1
snelson commentedI believe your issue was cause by the fact that AMFPHP's default error setting was not being set a string instead of as a bitmask/constant. I've committed a fix so that the default settings work out of the box, as well as made the settings form use constants instead of the bitmask integer. Committed #341176.