Page 1 of 1
Headers already sent error on Cataloger [solved]
Posted: Thu Feb 14, 2008 9:20 pm
by RichardC
Hi!
I'm working on a new look for balloonheaven.com, and am using the Cataloger module to catalog all the postcards and stickers I have. Unfortunately at the moment all the category-pages generate this error:
Warning: Cannot modify header information - headers already sent by (output started at /home/balloon/domains/balloonheaven.com/public_html/modules/Cataloger/action.defaultcategory.php:8) in /home/balloon/domains/balloonheaven.com/public_html/index.php on line 294
See for yourself on, for example,
http://www.balloonheaven.com/index.php?page=greetings-2
How do I fix this?
I am using CMSMS 1.2.3, and have the newest version of the cataloger module installed.
Re: Headers already sent error on Cataloger
Posted: Fri Feb 15, 2008 5:47 pm
by jan_hut
Richard,
This is a common error and it is caused by output being generated before the header is called.
you have posted te following line of code:
/home/balloon/domains/balloonheaven.com/public_html/modules/Cataloger/action.defaultcategory.php:

this would mean that there's output generated on line 8 in the file action.defaultcategory.php
can you post the first 20 lines of code for that file? make sure you use the "quote" option here and disable smilies
Re: Headers already sent error on Cataloger
Posted: Fri Feb 15, 2008 6:11 pm
by Nullig
Do you have some code after the tag in your template?
Nullig
Re: Headers already sent error on Cataloger
Posted: Sat Feb 16, 2008 1:03 pm
by RichardC
Nullig wrote:
Do you have some code after the tag in your template?
Nullig
Thanks for offering a possible solution, but if that was the case, each and every page using that template would generate the error.
Jan_hut, these are the first 20 lines of code:
Code: Select all
<?php
if (!isset($gCms)) exit;
if ($this->GetPreference('flush_cats','0') == '1')
{
while (ob_get_level() >0)
{
ob_end_flush();
}
}
$showMissing = '_'. $this->GetPreference('show_missing','1');
foreach ($params as $key=>$val)
{
$this->smarty->assign($key, $params[$key]);
}
list($curPage,$categoryItems) = $this->getCatalogItemsList($params);
Since it appears to only happen on category pages, I thought it might be helpfull to display the template for the category pages I use:
Code: Select all
{assign var="cols" value="4"}
<table>
{if $hasnav == 1}
<tr>
<td{if $cols gt 1} colspan="{$cols}"{/if} align=center>{$prev}{$navstr}{$next}</td></tr>
{/if}
<tr style="height: 180px;">
{section name=numloop loop=$items}
<td style="width: 200px;">
<a href="{$items[numloop].link}">
<img src="{$items[numloop].image}" alt="{$items[numloop].title}"/>
</a>
<br />
<a href="{$items[numloop].link}">
{$items[numloop].title}<br/>
For trading: {$items[numloop].trading}
</a>
</td>
{if not ($smarty.section.numloop.rownum mod $cols)}
{if not $smarty.section.numloop.last}
</tr>
<tr style="height: 180px;">
{/if}
{/if}
{if $smarty.section.numloop.last}
{math equation = "n - a % n" n=$cols a=$items|@count assign="cells"}
{if $cells ne $cols}
{section name=pad loop=$cells}
<td style="width: 200px;">
</td>
{/section}
{/if}
</tr>
{/if}
{/section}
{if $hasnav == 1}
<tr>
<td{if $cols gt 1} colspan="{$cols}"{/if} align=center>{$prev}{$navstr}{$next}</td></tr>
{/if}
</table>
Re: Headers already sent error on Cataloger
Posted: Tue Feb 19, 2008 5:33 am
by RichardC
The problem remains...
Re: Headers already sent error on Cataloger
Posted: Tue Feb 19, 2008 9:58 am
by alby
RichardC wrote:
How do I fix this?
I am using CMSMS 1.2.3, and have the newest version of the cataloger module installed.
Try to go: Extensions > Cataloger > Manage Preferences > Category Page Settings
change "Flush category page buffers"
and Clear cache in Site Admin> Global Settings
Alby
Re: Headers already sent error on Cataloger [solved]
Posted: Tue Feb 19, 2008 11:21 am
by RichardC
That solved it... Thank you very much!