It write me on ever page error:
warning: Cannot modify header information - headers already sent by (output started at /home/kafka/www/decin-ng/banner_file.php:70) in /home/kafka/www/decin-ng/includes/common.inc on line 139.
Where is problem?
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | banner_file_patch.txt | 380 bytes | erapetti |
Comments
Comment #1
sunPlease supply more information how you have implemented banner module, i.e. what is your 'advertisement' block doing?
Comment #2
erapetti commentedI was having a similar problem, with the error reporting different line numbers:
warning: Cannot modify header information - headers already sent by (output started at /var/www/html/ifiwn/banner_file.php:72) in /var/www/html/ifiwn/includes/common.inc on line 142.
I have banners in a banner group, and I'm using the provided block to show the banners.
After I refresh the cache the banners show for a while, then the error raise again.
I found that banner_file.php in line 72 has a foreach that works on $struct[0][0][$group] which may be null, and that adding that check to the previous "if" solve the problem.
I'm attaching a patch.
Comment #3
erapetti commentedI continued trying to figure out why in my case sometimes I have an empty $struct[0] and finally found out that it was due "anonymous user" had no permission to access taxonomy vocabulary "Banner groups". I'm using "taxonomy access" module, and banner.install left the permission to Ignore after creating the vocabulary.
So, the solution was to modify access control | category permissions | Banner group, setting "View" to "A".
After that the patch is no longer needed.
I'm reverting this issue status to "needs more info" because user kafik may have a different scenario.