In the admin pages I get these annoying warnings every now and then:
* warning: Cannot modify header information - headers already sent by (output started at /home/www/sos/banner_file.php:71) in /home/www/sos/includes/common.inc on line 139.
* warning: Cannot modify header information - headers already sent by (output started at /home/www/sos/banner_file.php:71) in /home/www/sos/includes/common.inc on line 139.
Comments
Comment #1
ñull commentedAlso on other pages.
Comment #2
ñull commentedAparently this warning comes up when one of the "Group display blocks" is not showing a banner. As a test I put two banners each on their own in a group and both groups' block enabled. So every now and then I only see one of the two banners, as if at random it would choose to show the second banner in the group, but there isn't a second banner.
I hope this added information helps to track the problem.
Comment #3
wulff commentedFixed in latest version of the cache handlers.
Comment #4
suit4 commentedeven if i use the latest version, i get that annoying warning
and it is not only on the admin pages, but in every page displaying banners.
is there a workaround?
Comment #5
suit4 commentedjust a note about the error source:
this error only occurs, if using banner_file.php.
banner_file.php is called like this
banner_file.php?group=0&count=1&terms=0&max=1&path=filesthe resulting error message is
Invalid argument supplied for foreach() in banner_file.php on line 72This error message causes the ' Cannot modify header information' warning.
banner_file.php:
Line 72 tries to acces $struct[0][0][$group] (as an array), which is empty if you didn't assign
the banner to a group.
A workaround simply could be a default value at the problematic point.
My question is:
how do I add a banner to a banner group?
Yes, thats funny, but where do I do that?
Comment #6
alexkb commentedI was getting this same error (banner_file.php:72), even with all the banners being assigned a banner group id. Anyway, I did some more searching around and found a fix on http://drupal.org/node/66063#comment-175309
In summary, the proper format for a module file is for it not to have a closing php tag. However, the banner_file.php isn't a module, and it is called independantly - so in plain english - it should.
I've added it to the end of my banner_file.php, leaving no white space - and it seems to have fixed this particular problem for me.
Comment #7
alexkb commentedHmm.. in actual fact its still doing it - and from what I can tell, its completely random - sometimes its the top banner, othertimes, its all banners - they don't display, and the admin log shows the banner_file.php:72 headers already sent fault. Maybe a post in the forums, might shed some light :/
Comment #8
cvining commentedWell, I too was seeing this error. Not all the time, but often.
Then I noticed the banner graphics weren't showing at all in MSIE. Just one of those X boxes, as if the graphic file wasn't available to server up. A look at the "properties" showed the URL for the banner graphic as
"http://sandbox.mydomain.com/system/files/logo-banner.gif"
Indeed, when I looked at the 'banner' table entry, in the 'cache' column, the above URL shows up. But my website is NOT at http://sandbox.mydomain.com, but actually http://www.mydomain.com. I had used the 'sandbox.' subdomain just to check things out. But it seems the banner module stores the full, absolute URL when you create the banner.
So, I went and edited & saved each banner. Now the "Cannot modify header" warning is gone and MSIE displays the banners correctly!
Other than that, I've had no trouble with the banner module and I like it a lot. Maybe in a future revision, it could store relative URLS, which should make it more friendly for certain multisite implementations too.
Thanks for all the fish!
- Cronin
Comment #9
sunPlease ensure that you also updated
banner_file.phpandbanner_db.phpin the root folder of your Drupal installation after updating Banner module. Updating both files solved these issues for me.Comment #10
wulff commented