Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"processattachments" API call results in high-severity errors in log #67

Open
MegaphoneJon opened this issue Aug 27, 2019 · 0 comments
Open

Comments

@MegaphoneJon
Copy link

Whenever the processattachments action is called I get this in my error logs:

a:6:{s:5:"%type";s:23:"Recoverable fatal error";s:8:"@message";O:25:"Drupal\Core\Render\Markup":1:{s:9:" * string";s:72:"Object of class CRM_Core_DAO_EntityFile could not be converted to string";}s:9:"%function";s:28:"CRM_Utils_Array::escapeXML()";s:5:"%file";s:69:"/var/www/mysite.org/vendor/civicrm/civicrm-core/CRM/Utils/Array.php";s:5:"%line";i:178;s:17:"@backtrace_string";s:957:"#0 /var/www/mysite.org/web/core/includes/bootstrap.inc(587): _drupal_error_handler_real(4096, 'Object of class...', '/var/www/mys...', 178, Array)                                                                              
#1 [internal function]: _drupal_error_handler(4096, 'Object of class...', '/var/www/crm.ag...', 178, Array)
#2 /var/www/mysite.org/vendor/civicrm/civicrm-core/CRM/Utils/Array.php(178): str_replace(Array, Array, Object(CRM_Core_DAO_EntityFile))                                                                                                    
#3 /var/www/mysite.org/vendor/civicrm/civicrm-core/CRM/Utils/Array.php(150): CRM_Utils_Array::escapeXML(Object(CRM_Core_DAO_EntityFile))                                                                                                   
#4 /var/www/mysite.org/vendor/civicrm/civicrm-core/CRM/Utils/REST.php(180): CRM_Utils_Array::xml(Array)
#5 /var/www/mysite.org/vendor/civicrm/civicrm-core/CRM/Utils/REST.php(107): CRM_Utils_REST::output(Array)
#6 /var/www/mysite.org/vendor/civicrm/civicrm-core/CRM/Utils/REST.php(118): CRM_Utils_REST->run()
#7 /var/www/mysite.org/web/libraries/civicrm/extern/rest.php(41): CRM_Utils_REST->bootAndRun()
#8 {main}";}

I don't have Outlook so I can't easily replicate this for testing, but it seems like the fix is to change the return line to cast the object to an array, because otherwise you're trying to return an object as XML. E.g.:

  return civicrm_api3_create_success((array) $entityFileDAO, $params);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant