Today I have found this error report in watchdog:

Type php

Date Thursday, August 6, 2015 - 09:19

User Anonymous

Location https://.../sitemap.xml

Message Warning: Cannot modify header information - headers already sent by (output started at /sites/all/modules/contrib/xmlsitemap/xmlsitemap.pages.inc:118) in _drupal_session_delete_cookie() (line 466 of /includes/session.inc).

As I can see you are using modified core function file_transfer(). And this bug related with this function. I have found issue described this bug. Please check #16 with patch. https://www.drupal.org/node/2148759#comment-8869415

#2 xmlsitemap-headers_already_sent-2546646-2.patch732 bytesAlexKirienko
PASSED: [[SimpleTest]]: [MySQL] 525 pass(es). View
Members fund testing for the Drupal project. Drupal Association Learn more


AlexKirienko created an issue. See original summary.

AlexKirienko’s picture

Status: Active » Needs review
732 bytes
PASSED: [[SimpleTest]]: [MySQL] 525 pass(es). View

I have ported patch #16 to xmlsitemap_file_transfer(). Please check attached patch.

dpovshed’s picture

Hi Alex,

I had the same problem and the solution you proposed worked for me perfectly!

However, I wasn't able to apply your patch by git apply (I have git v 1.9.1) and entered changes manually.

Probably it makes sense to regenerate the patch without header and footer; in its current form "git apply" just ignore the patch completely.