For some time now I have been getting some spurious warning messages at the top of some but not all reports. Can't see a pattern. I get it in Constituent Detail, but not my own report created from in some Mailing reports, but no Membership reports. I hoped an upgrade would sort it and have just upgraded to CiviCRM 5.24.6 and that hasn't made any difference. I don't see it in another CiviCRM site I run which I thought was set up the same. I'm on WordPress 5.4.1. I can live with it but other users will worry.

The warnings are:

Warning: htmlspecialchars() expects parameter 1 to be string, array given in /home/coma6771/public_html/crm/wp-content/plugins/civicrm/civicrm/packages/HTML/Common.php on line 144

Warning: Cannot modify header information - headers already sent by (output started at /home/coma6771/public_html/crm/wp-content/plugins/civicrm/civicrm/packages/HTML/Common.php:144) in /home/coma6771/public_html/crm/wp-admin/admin-header.php on line 9
  • Does ConfigAndLog have the full backtrace? If not, try some debugging at line 143 in Common.php that does CRM_Core_Error::debug_log_message(var_export($value, true)); CRM_Core_Error::debug_log_message(print_r(debug_backtrace(), true)); and then check ConfigAndLog when it happens. – Demerit May 8 '20 at 18:37
  • Thanks... nothing in ConfigAndLog. Tried your extra debug code before then after line 143 and it broke things with a gateway timeout error. – Mick Kahn May 9 '20 at 9:45
  • Oops sorry right that might try to log 100s of times. Should be if (is_array($value)) { CRM_Core_Error::debug_log_message(var_export($value, true)); CRM_Core_Error::debug_log_message(print_r(debug_backtrace(), true)); }. If that's still a problem you could leave out the backtrace line. Also do you have any custom fields in that constituent detail report? – Demerit May 9 '20 at 13:01
  • Thanks - I see now that the first debugging created 3GB of data! The second runs fine and produces 43MB though it doesn't mean anything to me. If I take out the backtrace line I get only a couple of lines that don't show anything useful. I do have custom fields in that report (though none selected to be displayed by default) but another report (Contribution and Membership Details) with all the same custom fields included does not give the warnings. – Mick Kahn May 10 '20 at 11:28
  • Just upgraded to 5.26.2 and the problem is still there – Mick Kahn Jun 18 '20 at 11:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.