CiviCRM

API errors

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Blocker Blocker
  • Resolution: Fixed/Completed
  • Affects Version/s: 4.1.0
  • Fix Version/s: 4.1.0
  • Component/s: None
  • Labels:
    None
  • Is MIH?:
    No
  • Code Sprint:
    No

Description

version
civicrm/ajax/rest?json=1&debug=1&version=3&entity=Contribution&action=get results in
Recoverable fatal error: Object of class CRM_Core_DAO could not be converted to string in civicrm_api3_generic_getfields() (line 19 of /home/www/sites/dev/sites/all/modules/civicrm/api/v3/Generic.php).

civicrm/ajax/rest?json=1&debug=1&version=3&entity=Email&action=get results in
Recoverable fatal error: Object of class CRM_Core_BAO_Email could not be converted to string in CRM_Utils_String::munge() (line 96 of /home/www/sites/dev/sites/all/modules/civicrm/CRM/Utils/String.php).

http://dev.wikimedia.se/en/civicrm/ajax/rest?json=1&debug=1&version=3&entity=MembershipType&action=get results in
Recoverable fatal error: Object of class CRM_Member_BAO_MembershipType could not be converted to string in CRM_Utils_String::munge() (line 96 of /home/www/sites/dev/sites/all/modules/civicrm/CRM/Utils/String.php).

Activity

Hide
Eileen McNaughton added a comment -
OK - issue it limited to when debug=1 is used - we'll have to add some unit tests against debug=1 to catch it
Show
Eileen McNaughton added a comment - OK - issue it limited to when debug=1 is used - we'll have to add some unit tests against debug=1 to catch it
Hide
Eileen McNaughton added a comment -
Hmm - doesn't seem to be 'debug' =1 - I added a test using this against email & it didn't happen. Also tried adding action to php params so this seems to be @ the json level ... X
Show
Eileen McNaughton added a comment - Hmm - doesn't seem to be 'debug' =1 - I added a test using this against email & it didn't happen. Also tried adding action to php params so this seems to be @ the json level ... X
Hide
xavier dutoit added a comment -
Hi,

So on my side (using fastcgi), it 500 internal error if is_debug, but works fine if no is_debug (both xml & json)

i'm trying with a db without any contributions !!! (insert various exclamations starting with WT.)

result when ok:
{"is_error":0,"version":3,"count":0,"values":[]}

Trying to insert various debug lines before it crashes.

@Holger

could you install xdebug easily? I've modified to add some debug messages if installed

X+
Show
xavier dutoit added a comment - Hi, So on my side (using fastcgi), it 500 internal error if is_debug, but works fine if no is_debug (both xml & json) i'm trying with a db without any contributions !!! (insert various exclamations starting with WT.) result when ok: {"is_error":0,"version":3,"count":0,"values":[]} Trying to insert various debug lines before it crashes. @Holger could you install xdebug easily? I've modified to add some debug messages if installed X+
Hide
xavier dutoit added a comment -
Got it,

1) The civicrm_api3_create_success wasn't modified to deal with the new param "action"
2) I modified civicrm_api3_create_success so it doesn't choke if the action is an array (eg. if the caller put the wrong parameter)

@eileen
For the 2, might be better to crash cleanly rather than silently ignore the problem?
Show
xavier dutoit added a comment - Got it, 1) The civicrm_api3_create_success wasn't modified to deal with the new param "action" 2) I modified civicrm_api3_create_success so it doesn't choke if the action is an array (eg. if the caller put the wrong parameter) @eileen For the 2, might be better to crash cleanly rather than silently ignore the problem?

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: