Body: <p>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.</p>
  
  <p>The warnings are:</p>
  
  <pre><code>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
  </code></pre>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-06-18T11:55:35.487Z
Comments.Text: Just upgraded to 5.26.2 and the problem is still there
Comments.UserDisplayName: Mick Kahn
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-05-08T18:37:03.807Z
Comments.Text: 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.
Comments.UserDisplayName: Demerit
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-05-09T09:45:47.500Z
Comments.Text: Thanks... nothing in ConfigAndLog. Tried your extra debug code before then after line 143 and it broke things with a gateway timeout error.
Comments.UserDisplayName: Mick Kahn
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-05-09T13:01:12.863Z
Comments.Text: 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?
Comments.UserDisplayName: Demerit
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-05-10T11:28:58.277Z
Comments.Text: 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.
Comments.UserDisplayName: Mick Kahn
Tags: <wordpress><reports>
Title: Warning messages on some reports
ThreadText: # Warning messages on some reports
  
  (Asked by: username_0 on 2020-05-08)
  
  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
  
  **Tags:** wordpress, reports
  
  > **Comments:**
  > **username_1**: 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.  
  > **username_0**: Thanks... nothing in ConfigAndLog. Tried your extra debug code before then after line 143 and it broke things with a gateway timeout error.  
  > **username_1**: 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?  
  > **username_0**: 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.  
  > **username_0**: Just upgraded to 5.26.2 and the problem is still there  
  
  ---
  
  ## 0 answers
  
  