cheesypeas

Topic: Two issues with 1.9 - headers already sent / category count

I just installed 1.9 and firstly if I change the theme to hireme in the admin section I get the following error log:

PHP Warning:  Cannot modify header information - headers already sent by .../_templates/hireme/_cache/%%F7^F7F^F7F34188%%header.tpl.php on line 4

Secondly I would like the job count to display next to the category list, similar to the stats on the sidebar. I see that the function is called using {$categories[tmp].categ_count} in the following code:

{section name=tmp loop=$categories}
    <li id="{$categories[tmp].var_name}" {if $current_category == $categories[tmp].var_name}class="selected"{/if}><a href="{$BASE_URL}{$URL_JOBS}/{$categories[tmp].var_name}/" title="{$categories[tmp].name}">{$categories[tmp].name}<span>({$categories[tmp].categ_count})</span></a></li>
{/section}

However all that is displayed is two brackets () with no count in the middle. Does anyone know how I can solve these two issues? Any help would be much appreciated.

cheesypeas

Re: Two issues with 1.9 - headers already sent / category count

I've downloaded the cache folder and included line 1 - 5 of the cache header.tpl below:

<?php /* Smarty version 2.6.26, created on 2010-04-05 13:05:11
         compiled from header.tpl */ ?>
<?php if ($this->_tpl_vars['CURRENT_PAGE'] == 'page-unavailable' || $this->_tpl_vars['CURRENT_PAGE'] == 'job-unavailable'): ?>
    <?php header("HTTP/1.0 404 Not Found"); ?>
<?php endif; ?>

Incidentally these lines are identitcal to the cache header.tpl file created using the default template but for some reason I don't get the error logs when using the default template. Is anybody else getting this error?

Also I would like to know about the other issure I wrote about, does anyone know how I can get the jobs count to display next to the category list?

lonestriker

Re: Two issues with 1.9 - headers already sent / category count

I get this as well...

Warning: Cannot modify header information - headers already sent by (output started at /home/content/t/e/a/teambelafonte/html/jobs/_templates/default/_cache/%%F7^F7F^F7F34188%%header.tpl.php:4) in /home/content/t/e/a/teambelafonte/html/jobs/_templates/default/_cache/%%F7^F7F^F7F34188%%header.tpl.php on line 4

any ideas?

rich

Re: Two issues with 1.9 - headers already sent / category count

Me too. I get the following after installing 1.9

Warning: Cannot modify header information - headers already sent by (output started at /var/www/prod/_config/config.envs.php:60) in /var/www/prod/_config/config.php on line 135

Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /var/www/prod/_config/config.envs.php:60) in /var/www/prod/_config/config.php on line 136

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /var/www/prod/_config/config.envs.php:60) in /var/www/prod/_config/config.php on line 136

EDIT: BTW I am using the 1.9 zip from code.google.com

This is from config.php:

134         date_default_timezone_set('Europe/London');
135         header('Content-Type: text/html; charset=UTF-8');
136         session_start();

config.envs.php doesn't have a line 60 (that's the EOF marker)

Last edited by rich (2010-04-08 13:27:15)

rich

Re: Two issues with 1.9 - headers already sent / category count

Hi there.

I can't seem to get past this problem.

It isn't fixed by adding an explicit session directory, as the first error occurs before the session starts. (My /var/lib/php5 directory is correctly permissioned anyway).

I guess the question is, why does config.envs.php start sending data?

cheesypeas

Re: Two issues with 1.9 - headers already sent / category count

With respect rich I think your issue is different to my and lonestriker's. We have problems with line 4 of the cached template file, but it is purely academic because this board seems to be dead, we may as well be speaking gibberish big_smile

links

Re: Two issues with 1.9 - headers already sent / category count

Hi,

Have you made the _cache folder in hireme writable? The _templates/hireme/_cache folder has to have 777 Linux permissions. Then delete all the files inside it and try to refresh the site.

cheesypeas

Re: Two issues with 1.9 - headers already sent / category count

Hi links,

yes both default and hireme were set to 755, default works but hireme produces the aforementioned error. I had tried deleting all the cache files in both themes and change the permissions to 777 as suggested and nothing has changed. Default seems to be fine, but as I said after deleting the cache files and the error_log file in the root, then simply accesing the homepage using hireme instantly creates an error_log file with the line: PHP Warning:  Cannot modify header information - headers already sent by .../_templates/hireme/_cache/%%F7^F7F^F7F34188%%header.tpl.php on line 4

It is clearly a problem with the hireme theme although having said that I have noticed that lonestriker's error is with the default theme and thinking back to when I first discovered the error_log file I believe mine too may have stated default also, although I can't get it to fail on that theme now. Strange I'm sure, but as I said it always fails on hireme even though line 4 is exactly the same on both themes.

links

Re: Two issues with 1.9 - headers already sent / category count

Sorry, but I can't figure out the problem without seing the code. If you want to give me the link to your site or ftp access, you can write me a private message so I can take a look.

links

Re: Two issues with 1.9 - headers already sent / category count

@rich - what do you mean, config.envs.php doesn't have a line 60? It has 81 lines...are you sure the file was uploaded correctly?

cheesypeas

Re: Two issues with 1.9 - headers already sent / category count

Hey Links thanks for that,

Lonestriker you can solve this by removing the spaces from the first few lines in the header.tpl file so that it reads as follows:

{if $CURRENT_PAGE == 'page-unavailable' || $CURRENT_PAGE == 'job-unavailable'}{php}header("HTTP/1.0 404 Not Found");{/php}{/if}

This is a strange one for me because the spaces are present in the default template but that works fine. For one reason or another the hireme theme would only work by removing the spaces, perhaps someone here can explain why, but lonestriker and anyone else with this problem, give it a try, it worked for me. And thanks again Links for investigating it, you are a gem.

rich

Re: Two issues with 1.9 - headers already sent / category count

@links - yes I definitely have all the correct files, I pulled the zip from google code via wget and unpacked it straight into /var/www/.

I deleted the "localhost" entry from the config.envs.php as I don't need it, which is why my config.envs.php is shorter.

@cheesypeas - sorry I didn't mean to thread-jack. Let me know if I should start a fresh one.

Guys you can see the errors I'm seeing here: http://www.sydneyitjobs.com/

PS: append "test.php" to the URL to see phpinfo()

thanks

Last edited by rich (2010-04-12 01:15:26)

lonestriker

Re: Two issues with 1.9 - headers already sent / category count

That worked for me.  Thanks much!  Although now im struggling with the admin section but that a different issue.