2

We're facing an issue with contact exports. They become displayed in the browsers as raw text.

We recently updated to php 7.1 and CiviCRM 5.25.0 but unfortunately and due to infrequent use of the export functionality we can't say if any of these changes directly led to the problem.

Does anybody has the slightest idea what could be causing this?

Thx in advance

2

If you have something like a file with a blank line at the top that might get output before the export data and cause the output to be interpreted as http content-type text instead of a download.

Check civicrm.settings.php or extensions or files in the CMS that might have changed.

You could also try running this from the root folder of your CMS:

find . -type f -exec awk 'NR==1&&/^$/{print FILENAME}' \{\} \;

or maybe this if the line isn't completely blank, like a couple tabs:

find . -type f -exec awk 'NR==1&&/^\s*$/{print FILENAME}' \{\} \;

https://askubuntu.com/a/1072314

| improve this answer | |
  • Agreeing with this - I find that usually the problem is a blank line introduced in a theme. A quick way to isolate the problem is to change to a stock theme and see if the problem persists. – Jon G - Megaphone Tech Jul 2 at 22:31
  • Thanks, but I'm afraid this isn't the case. If I save the file, it's just a perfect csv. – nielo Jul 3 at 18:30
  • Demerit, what settings in civicrm.settings.php could cause this? – nielo Jul 3 at 19:13
  • 1
    It's not a setting. I've updated answer with something you can try. – Demerit Jul 3 at 19:30
  • Thanks! Shouldn't I rstrict this find to php files? – nielo Jul 3 at 19:41

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.