Zen Cart Logo
Forums / Addon Language Packs / Header Warning and PHP Fatal error after uploaded a Dutch Language pack

Header Warning and PHP Fatal error after uploaded a Dutch Language pack

Views: 3,708

Results 1 to 10 of 10
25 May 2012, 4:14 PM
#1
sfninja avatar

sfninja

New Zenner

Join Date:
May 2012
Posts:
6
Plugin Contributions:
0

Header Warning and PHP Fatal error after uploaded a Dutch Language pack

I've been having this problem since yesterday, I did a lot of Googling but did not find a solution, sinçe i'm fairly new to ZenCart I might even have overlooked something. The problem started when I uploaded a Dutch Language pack, now whenever I want to add something to the Cart I get a blank page. I only get the issue when I use the Dutch Language in my store, if I use the standard English; everything works as it should

Here is the Debug:

[25-May-2012 15:34:57 UTC] PHP Warning:  Cannot modify header information - headers already sent by (output started at /var/www/vhosts/website.nl/httpdocs/includes/languages/dutch.php:1) in /var/www/vhosts/website.nl/httpdocs/includes/init_includes/init_templates.php on line 78

[25-May-2012 15:34:57 UTC] PHP Fatal error:  Call to a member function RecordCount() on a non-object in /var/www/vhosts/website/httpdocs/includes/modules/sideboxes/category_row.php on line 18

Line 78 in init_templates.php

  header("Content-Type: text/html; charset=" . CHARSET);

Line 18 in category_row.php

  $num_categories = $categories->RecordCount();

Help would be greatly appreciated.

25 May 2012, 4:25 PM
#2
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Location:
Lansing, Michigan USA
Posts:
19,793
Plugin Contributions:
2

Re: Header Warning and PHP Fatal error after uploaded a Dutch Language pack

Have you checked your /cache folder for error log files ?
http://www.zen-cart.com/content.php?124-blank-page

25 May 2012, 4:29 PM
#3
sfninja avatar

sfninja

New Zenner

Join Date:
May 2012
Posts:
6
Plugin Contributions:
0

Re: Header Warning and PHP Fatal error after uploaded a Dutch Language pack

stevesh:

Have you checked your /cache folder for error log files ?

Yes, the outputs in my first post come from the error log file (httpdocs/cache/mydebug-verylongernumber.log)

26 May 2012, 9:44 AM
#4
sfninja avatar

sfninja

New Zenner

Join Date:
May 2012
Posts:
6
Plugin Contributions:
0

Re: Header Warning and PHP Fatal error after uploaded a Dutch Language pack

I'm still looking for a sulution to this

26 May 2012, 10:22 AM
#6
sfninja avatar

sfninja

New Zenner

Join Date:
May 2012
Posts:
6
Plugin Contributions:
0

Re: Header Warning and PHP Fatal error after uploaded a Dutch Language pack

stevesh:

Most likely a stray character or line added to dutch.php.

http://www.zen-cart.com/content.php?129-warning-headers-already-sent

I already looked at this and its not the case. There is no additional line or character anywhere in line 1 of dutch.php.

The Fatal Error seems to be the likely cause but I have no idea what to do with it:

[25-May-2012 15:34:57 UTC] PHP Fatal error:  Call to a member function RecordCount() on a non-object in /var/www/vhosts/website/httpdocs/includes/modules/sideboxes/category_row.php on line 18
26 May 2012, 10:57 AM
#7
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Header Warning and PHP Fatal error after uploaded a Dutch Language pack

You probably don't have any categories enabled for that language, and thus the $categories object doesn't have any elements, so it can't have any results from RecordCount().

26 May 2012, 11:15 AM
#8
sfninja avatar

sfninja

New Zenner

Join Date:
May 2012
Posts:
6
Plugin Contributions:
0

Re: Header Warning and PHP Fatal error after uploaded a Dutch Language pack

DrByte:

You probably don't have any categories enabled for that language, and thus the $categories object doesn't have any elements, so it can't have any results from RecordCount().

I just checked and all my categories show up fine, when I click them I get to see my products, its just that when I press "Add to Cart" in the Dutch localization that I get redirected to a blank page. When I add the product to my cart in English and switch to Dutch once I get redirected I get another error when I hit "Go to Checkout"

This is the error from my Cache when I hit "Go to Checkout" in the Dutch localization, it also brings me to a blank page.

[26-May-2012 11:12:25 UTC] PHP Warning:  Cannot modify header information - headers already sent by (output started at /var/www/vhosts/gezondepetshop.nl/httpdocs/includes/languages/dutch.php:1) in /var/www/vhosts/gezondepetshop.nl/httpdocs/includes/init_includes/init_templates.php on line 78

[26-May-2012 11:12:25 UTC] PHP Warning:  Cannot modify header information - headers already sent by (output started at /var/www/vhosts/gezondepetshop.nl/httpdocs/includes/languages/dutch.php:1) in /var/www/vhosts/gezondepetshop.nl/httpdocs/includes/functions/functions_general.php on line 45

But these are only warnings, not Fatal Errors like in my first post.

26 May 2012, 11:38 AM
#9
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Header Warning and PHP Fatal error after uploaded a Dutch Language pack

SFNinja:

(output started at /var/www/vhosts/gezondepetshop.nl/httpdocs/includes/languages/dutch.php:1)
If you don't fix that problem, then the errors won't go away.

Get rid of the extra characters in the file.
They may be invisible characters, such as a ByteOrderMark set by your text editor or by whomever you obtained the files from.
Your files need to be saved as UTF-8-without-BOM. You do that by setting your text editor's encoding settings to utf8-without-BOM, then save the file. Then re-upload the file to your server.
Wash,rinse,repeat for all your language files.

If you look at the language files that came with Zen Cart, you'll see that they all contain a small note explaining this to you. It doesn't matter if it's English or another language. You can't have BOM's in the language files (or any of the files, for that matter).

26 May 2012, 11:51 AM
#10
sfninja avatar

sfninja

New Zenner

Join Date:
May 2012
Posts:
6
Plugin Contributions:
0

Re: Header Warning and PHP Fatal error after uploaded a Dutch Language pack

wow, thanks a lot! I opened the dutch.php with notepad++ and changed the encoding from UTF-8 to utf8-without-BOM like you said and now its working !
I actually did try this earlier but in notepad (stupid me) and I thought I had solved the invisible character issue.

Thanks a lot for helping me out DrByte, and stevesh too :D