When I click on the RSS icon for my events in Civi, I get the following error.

error on line 2 at column 6: XML declaration allowed only at the start of the document

From searching, it appears that this happens most commonly when there's added white space in a file.

I've tried editing ./civicrm/templates/CRM/COre/Calendar/Rss.tpl to no avail.

Where else can I look to see if there's added white space? Any other ideas?

Thanks in advance.


enter image description here

The RSS links to https://focusdc.org/civicrm/event/ical?reset=1&list=1&rss=1

  • Can you please include a screenshot that indicates which RSS icon you're clicking? I see iCal icons for events but not RSS. Thanks! – Jon G - Megaphone Tech Sep 6 '17 at 16:46
  • 1
    Hi Jon G. I edited the post above to include a screenshot. – jansmath3 Sep 6 '17 at 18:54

From your screenshot, I was able to test this same functionality on two test sites (a good general troubleshooting tactic!). The problem does NOT replicate itself there. The issue is specific to your site, or (less likely) reflects a bug in an older version of CiviCRM than the ones I'm testing.

I was able to use your link to see the exact error - and you're correct, the issue is a blank line.

Since you're using Drupal, I would look for a blank line at the end of settings.php and template.php. I would also try testing whether the problem disappears if you change themes (preferably on a test copy of your site). That will help you isolate whether the problem is in your theme.

  • Thanks Jon G! That did it. There was actually a space at the start of the settings.php and 2 at the end of the template.php. – jansmath3 Sep 8 '17 at 12:53
  • Great! I'll add a comment for others that looking at the beginning is actually more helpful, since lines at the end of a file are in many cases ignored. – Jon G - Megaphone Tech Sep 8 '17 at 12:57

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.