CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • htmlspecialchars() expects parameter 1 to be string | Common.php on line 144
Pages: [1]

Author Topic: htmlspecialchars() expects parameter 1 to be string | Common.php on line 144  (Read 2166 times)

markjohan

  • I post occasionally
  • **
  • Posts: 102
  • Karma: 0
  • ..
  • CiviCRM version: 4.4.2
  • CMS version: Wordpress 3.6.1
  • MySQL version: 5.1.66-0+squeeze1
  • PHP version: 5.3.27
htmlspecialchars() expects parameter 1 to be string | Common.php on line 144
October 22, 2013, 01:04:22 am
When i click on the page  "Constituent Summary" at Rapports, i get this warning:

Warning: htmlspecialchars() expects parameter 1 to be string, array given in ../plugins/civicrm/civicrm/packages/HTML/Common.php on line 144

Does someone knows how i can solve this problem?

Thanks!

markjohan

  • I post occasionally
  • **
  • Posts: 102
  • Karma: 0
  • ..
  • CiviCRM version: 4.4.2
  • CMS version: Wordpress 3.6.1
  • MySQL version: 5.1.66-0+squeeze1
  • PHP version: 5.3.27
Re: htmlspecialchars() expects parameter 1 to be string | Common.php on line 144
October 22, 2013, 01:14:33 am
Could it be something causes by unused components? That are in the list?

asdl

  • I’m new here
  • *
  • Posts: 18
  • Karma: 0
  • CiviCRM version: 4.4.5
  • CMS version: WordPress 3.9.1
  • MySQL version: 5.0.10
  • PHP version: 5.4.17
Re: htmlspecialchars() expects parameter 1 to be string | Common.php on line 144
June 10, 2014, 09:08:21 pm
How did you solve this? I've got exactly the same problem now on a WordPress Civi install...

asdl

  • I’m new here
  • *
  • Posts: 18
  • Karma: 0
  • CiviCRM version: 4.4.5
  • CMS version: WordPress 3.9.1
  • MySQL version: 5.0.10
  • PHP version: 5.4.17
Re: htmlspecialchars() expects parameter 1 to be string | Common.php on line 144
June 11, 2014, 11:34:49 am
On my new WP install, which I'm still setting up (only 157 contacts, no memberships or contributions, one test mailing, five custom fields), 9 of Civi's 32 reports bring up a series of E_Warning errors:

These 8 reports
Constituent Summary, Constituent Detail, Current Employees, Event Participants, Attendee List, Mail Bounces, Mail Opened, Mail Clickthroughs
bring up these errors:

Code: [Select]
Warning: htmlspecialchars() expects parameter 1 to be string, array given in /home/bpoolyc/webapps/bpoolyc_wp/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/bpoolyc/webapps/bpoolyc_wp/wp-content/plugins/civicrm/civicrm/packages/HTML/Common.php:144) in/home/bpoolyc/webapps/bpoolyc_wp/wp-includes/option.php on line 747

Warning: Cannot modify header information - headers already sent by (output started at /home/bpoolyc/webapps/bpoolyc_wp/wp-content/plugins/civicrm/civicrm/packages/HTML/Common.php:144) in/home/bpoolyc/webapps/bpoolyc_wp/wp-includes/option.php on line 748

The Soft Credits report causes these errors:
Code: [Select]
Warning: implode(): Invalid arguments passed in /home/bpoolyc/webapps/bpoolyc_wp/wp-content/plugins/civicrm/civicrm/CRM/Report/Form/Contribute/SoftCredit.php on line 434


Warning: implode(): Invalid arguments passed in /home/bpoolyc/webapps/bpoolyc_wp/wp-content/plugins/civicrm/civicrm/CRM/Report/Form/Contribute/SoftCredit.php on line 443


Warning: Cannot modify header information - headers already sent by (output started at /home/bpoolyc/webapps/bpoolyc_wp/wp-content/plugins/civicrm/civicrm/CRM/Report/Form/Contribute/SoftCredit.php:434) in /home/bpoolyc/webapps/bpoolyc_wp/wp-includes/option.php on line 747


Warning: Cannot modify header information - headers already sent by (output started at /home/bpoolyc/webapps/bpoolyc_wp/wp-content/plugins/civicrm/civicrm/CRM/Report/Form/Contribute/SoftCredit.php:434) in /home/bpoolyc/webapps/bpoolyc_wp/wp-includes/option.php on line 748

They happen whether I turn off all my plugins, and/or switch to a default WP TwentyFourteen or TwentyThirteen theme.

I've tried replacing the Common.php file with a new one from a newly downloaded 4.4.5 CiviCRM, searching for empty space before the closing php ?> tags, and combing my civicrm.settings.php file.

I can't recreate it on the Sandbox, or on any of my other CiviCRM WP installs. Most of the posts I've seen about it refer to Drupal installs and are years old, and most were solved by updating. Any ideas on how I can fix this?


markjohan

  • I post occasionally
  • **
  • Posts: 102
  • Karma: 0
  • ..
  • CiviCRM version: 4.4.2
  • CMS version: Wordpress 3.6.1
  • MySQL version: 5.1.66-0+squeeze1
  • PHP version: 5.3.27
Re: htmlspecialchars() expects parameter 1 to be string | Common.php on line 144
June 11, 2014, 12:50:22 pm
Hello asdl,

I have no solution for this. But i also havent got this again. I had some problem by users. So i have "Synchronize Users to Contacts"..

Maybe someone else can help you?

asdl

  • I’m new here
  • *
  • Posts: 18
  • Karma: 0
  • CiviCRM version: 4.4.5
  • CMS version: WordPress 3.9.1
  • MySQL version: 5.0.10
  • PHP version: 5.4.17
Re: htmlspecialchars() expects parameter 1 to be string | Common.php on line 144
April 21, 2015, 06:53:12 am
Almost a year later, with updated WordPress (4.1.1) and CiviCRM (4.6.0), I rediscovered this problem when calling up certain reports.

Troubleshooting by turning off all Civi extensions, WP plugins, and changing WP theme to Twenty Fifteen default had no change.

But reading this five-year-old thread
https://www.drupal.org/node/829250
about the problem with Civi Drupal led me to think about developer-created inputs that might be arrays instead of single fields, which led me to think about my site's Custom Fields - a set of about six "extra" data fields we collect for each member.

Disabled that "BPYC Info" set under Administer>Customize Data and Screens >Custom Fields and - Volia! - problem gone.

Now looking to see if I can rebuild those Custom Fields in a way that won't bring back this error...

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • htmlspecialchars() expects parameter 1 to be string | Common.php on line 144

This forum was archived on 2017-11-26.