Headers already sent error on Cataloger [solved]

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
RichardC
Forum Members
Forum Members
Posts: 59
Joined: Tue Aug 08, 2006 11:04 am

Headers already sent error on Cataloger [solved]

Post 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.
Last edited by RichardC on Tue Feb 19, 2008 11:20 am, edited 1 time in total.
jan_hut
Forum Members
Forum Members
Posts: 60
Joined: Sat Jul 01, 2006 1:48 pm

Re: Headers already sent error on Cataloger

Post 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: 8)
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
Last edited by jan_hut on Fri Feb 15, 2008 9:12 pm, edited 1 time in total.
User avatar
Nullig
Power Poster
Power Poster
Posts: 2380
Joined: Fri Feb 02, 2007 4:31 pm

Re: Headers already sent error on Cataloger

Post by Nullig »

Do you have some code after the tag in your template?

Nullig
RichardC
Forum Members
Forum Members
Posts: 59
Joined: Tue Aug 08, 2006 11:04 am

Re: Headers already sent error on Cataloger

Post 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>
RichardC
Forum Members
Forum Members
Posts: 59
Joined: Tue Aug 08, 2006 11:04 am

Re: Headers already sent error on Cataloger

Post by RichardC »

The problem remains...
alby

Re: Headers already sent error on Cataloger

Post 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
RichardC
Forum Members
Forum Members
Posts: 59
Joined: Tue Aug 08, 2006 11:04 am

Re: Headers already sent error on Cataloger [solved]

Post by RichardC »

That solved it... Thank you very much!
Post Reply

Return to “CMSMS Core”