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) »
  • Export of contacts fails Export.php:600 (after upgrade,doesn't´matter if 1 or 8000).
Pages: [1]

Author Topic: Export of contacts fails Export.php:600 (after upgrade,doesn't´matter if 1 or 8000).  (Read 619 times)

Mich___

  • I post occasionally
  • **
  • Posts: 30
  • Karma: 0
  • CiviCRM version: 4.7.6
  • CMS version: WordPress
  • MySQL version: 5
  • PHP version: 5.4.32
Export of contacts fails Export.php:600 (after upgrade,doesn't´matter if 1 or 8000).
March 16, 2015, 06:18:49 am

Hi all,

unfortunately, after the upgrade to 4.5.6 we have some troubles with exporting contacts.
It doesn´t matter if we use 1 contact or 8000, we are linked to a white screen with following error message:
Quote
Warning: strpos(): Empty needle in /home/gemeingut/www/www/wp-content/plugins/civicrm/civicrm/CRM/Export/BAO/Export.php on line 600

Warning: Cannot modify header information - headers already sent by (output started at /home/gemeingut/www/www/wp-content/plugins/civicrm/civicrm/CRM/Export/BAO/Export.php:600) in /home/gemeingut/www/www/wp-content/plugins/civicrm/civicrm/CRM/Utils/System.php on line 833

Warning: Cannot modify header information - headers already sent by (output started at /home/gemeingut/www/www/wp-content/plugins/civicrm/civicrm/CRM/Export/BAO/Export.php:600) in /home/gemeingut/www/www/wp-content/plugins/civicrm/civicrm/CRM/Utils/System.php on line 834

Warning: Cannot modify header information - headers already sent by (output started at /home/gemeingut/www/www/wp-content/plugins/civicrm/civicrm/CRM/Export/BAO/Export.php:600) in /home/gemeingut/www/www/wp-content/plugins/civicrm/civicrm/CRM/Utils/System.php on line 850

Warning: Cannot modify header information - headers already sent by (output started at /home/gemeingut/www/www/wp-content/plugins/civicrm/civicrm/CRM/Export/BAO/Export.php:600) in /home/gemeingut/www/www/wp-content/plugins/civicrm/civicrm/CRM/Utils/System.php on line 851
"CiviCRM ID","Kontaktart","Kontakt-Unterkategorie","Keine E-Mails senden","Nicht anrufen","Nicht per Post anschreiben","Keine SMS senden","Nicht an andere verkaufen","Keine Massen-E-Mails (User Opt out)","Gesetzliche Identifikation","Externe Identifikation","Sortierungsname","Anzeige-Name","Spitzname","gesetzlicher Name","Bild URL","Kommunikationspräferenzen","Bevorzugte Sprache","Bevorzugtes Email Format","Kontakt-Hash","Bezugsquelle","Vorname","Zweiter Vorname","Nachname","Anrede","Nachgestellter Namenszusatz (Suffix) einer Person","Formeller


The log file shows:
Quote
content/plugins/civicrm/civicrm/CRM/Utils/System.php on line 833
[16-Mar-2015 12:49:27 UTC] PHP Warning:  Cannot modify header information - headers already sent by (output started at /home/gemeingut/www/www/wp-content/plugins/civicrm/civicrm/CRM/Export/BAO/Export.php:600) in /home/gemeingut/www/www/wp-content/plugins/civicrm/civicrm/CRM/Utils/System.php on line 834
[16-Mar-2015 12:49:27 UTC] PHP Warning:  Cannot modify header information - headers already sent by (output started at /home/gemeingut/www/www/wp-content/plugins/civicrm/civicrm/CRM/Export/BAO/Export.php:600) in /home/gemeingut/www/www/wp-content/plugins/civicrm/civicrm/CRM/Utils/System.php on line 850
[16-Mar-2015 12:49:27 UTC] PHP Warning:  Cannot modify header information - headers already sent by (output started at /home/gemeingut/www/www/wp-content/plugins/civicrm/civicrm/CRM/Export/BAO/Export.php:600) in /home/gemeingut/www/www/wp-content/plugins/civicrm/civicrm/CRM/Utils/System.php on line 851

Any hints how to solve this problem?
The civihosting provider support didn´t feel responsible for this issue.

Best wishes, Michael
« Last Edit: March 16, 2015, 06:26:49 am by Mich___ »

JonGold

  • Ask me questions
  • ****
  • Posts: 638
  • Karma: 81
    • Palante Technology
  • CiviCRM version: 4.1 to the latest
  • CMS version: Drupal 6-7, Wordpress 4.0+
  • PHP version: PHP 5.3-5.5
Re: Export of contacts fails Export.php:600 (after upgrade,doesn't´matter if 1 or 8000).
March 16, 2015, 07:27:12 am
Hi Michael,

The issue is that when PHP programs like CiviCRM generate a CSV file (or any file that's intended to be downloaded), the generated file must contain nothing but the CSV.  That is, you can't load part of a page, then say, "OK, make this a CSV to download".  Unfortunately, CiviCRM is generating a warning before it generates the CSV, then it's saying, "Hey, because I already sent this warning to the screen, I can't generate a CSV".  That's the "cannot modify header information - headers already sent" warnings you're seeing - it's because CiviCRM reported that first warning to you.

So there's three solutions here:  Fix the warning, work around the warning, or suppress the warning.

* The warning seems to be introduced by work done here https://issues.civicrm.org/jira/browse/CRM-15301.  A coder could probably fix this without much work.
* If my quick reading of the code is correct, the problem comes up only when your contacts aren't sorted.  Try clicking on a header of your search results to sort them before you export, let us know if that fixes the problem?
* Finally, you can suppress warnings: http://php.net/manual/en/function.error-reporting.php.  I suspect this is why we don't see the same problem on the demo server.

Sign up to StackExchange and get free expert CiviCRM advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

Mich___

  • I post occasionally
  • **
  • Posts: 30
  • Karma: 0
  • CiviCRM version: 4.7.6
  • CMS version: WordPress
  • MySQL version: 5
  • PHP version: 5.4.32
Re: Export of contacts fails Export.php:600 (after upgrade,doesn't´matter if 1 or 8000).
March 16, 2015, 07:59:15 am
Thanks JonGold,
terrific.

Since nr. 2 doesn´t work, I will try nr. 3 for a test:

error_reporting(0);

In which php file would I write this command?

Best wishes and thanks, Michael

JonGold

  • Ask me questions
  • ****
  • Posts: 638
  • Karma: 81
    • Palante Technology
  • CiviCRM version: 4.1 to the latest
  • CMS version: Drupal 6-7, Wordpress 4.0+
  • PHP version: PHP 5.3-5.5
Re: Export of contacts fails Export.php:600 (after upgrade,doesn't´matter if 1 or 8000).
March 16, 2015, 08:14:21 am
Best to set that in php.ini like this:
Code: [Select]
ini_set("error_reporting", 0);
Otherwise...I'm not 100% sure!  wp-config.php perhaps?
Sign up to StackExchange and get free expert CiviCRM advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

Mich___

  • I post occasionally
  • **
  • Posts: 30
  • Karma: 0
  • CiviCRM version: 4.7.6
  • CMS version: WordPress
  • MySQL version: 5
  • PHP version: 5.4.32
Re: Export of contacts fails Export.php:600 (after upgrade,doesn't´matter if 1 or 8000).
March 16, 2015, 11:58:56 am
Terrific help, thank you!

This seems to work!
Will test everything now.
« Last Edit: March 16, 2015, 12:28:12 pm by Mich___ »

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Export of contacts fails Export.php:600 (after upgrade,doesn't´matter if 1 or 8000).

This forum was archived on 2017-11-26.