Zen Cart Logo
Forums / Upgrading to 1.5.x / Upgrading from 1.55e to 1.57d - problems with language files

Upgrading from 1.55e to 1.57d - problems with language files

Views: 1,969

Results 1 to 15 of 15
17 Apr 2022, 14:50
#1
ormhaugen avatar

ormhaugen

New Zenner

Join Date:
Apr 2009
Posts:
32
Plugin Contributions:
0

Upgrading from 1.55e to 1.57d - problems with language files

I have upgraded my ZC from 1.55e to 1.57d. My shop is a bookshop for local history. Everything seems to be alright with the English and the German versions of the shop. Testing both versions I can place orders and orders are getting through to my email inbox. But when I try to install the Norwegian language files, I can only navigate around looking at different books. As soon as I click 'Add to cart' I get a blank page. Same when clicking 'Write a review' or 'Search'. The Norwegian language files I have been using from ver. 1. 39, at several upgrades I have just uploaded them to the server and everything has been working. But this time: no. I have no other plugins. I get a lot of log files, enclosing the log file showing up when clicking 'Add to cart'.
[17-Apr-2022 14:40:41 UTC] Request URI: /butikk157d/index.php?main_page=product_info&cPath=1&products_id=22, IP address: .
#1 header() called at [/customers/b/9/1/c8eok39a9/webroots/r510470/butikk157d/includes/init_includes/init_templates.php:80]
#2 require_once(/customers/b/9/1/c8eok39a9/webroots/r510470/butikk157d/includes/init_includes/init_templates.php) called at [/customers/b/9/1/c8eok39a9/webroots/r510470/butikk157d/includes/autoload_func.php:37]
#3 require(/customers/b/9/1/c8eok39a9/webroots/r510470/butikk157d/includes/autoload_func.php) called at [/customers/b/9/1/c8eok39a9/webroots/r510470/butikk157d/includes/application_top.php:222]
#4 require(/customers/b/9/1/c8eok39a9/webroots/r510470/butikk157d/includes/application_top.php) called at [/customers/b/9/1/c8eok39a9/webroots/r510470/butikk157d/index.php:25]
--> PHP Warning: Cannot modify header information - headers already sent by (output started at /customers/b/9/1/c8eok39a9/webroots/r510470/butikk157d/includes/languages/norwegian.php:1) in /customers/b/9/1/c8eok39a9/webroots/r510470/butikk157d/includes/init_includes/init_templates.php on line 80.

[17-Apr-2022 14:40:41 UTC] Request URI: /butikk157d/index.php?main_page=product_info&cPath=1&products_id=22, IP address: .
#1 header() called at [/customers/b/9/1/c8eok39a9/webroots/r510470/butikk157d/includes/templates/responsive_classic/common/html_header.php:20]
#2 require(/customers/b/9/1/c8eok39a9/webroots/r510470/butikk157d/includes/templates/responsive_classic/common/html_header.php) called at [/customers/b/9/1/c8eok39a9/webroots/r510470/butikk157d/index.php:42]
--> PHP Warning: Cannot modify header information - headers already sent by (output started at /customers/b/9/1/c8eok39a9/webroots/r510470/butikk157d/includes/languages/norwegian.php:1) in /customers/b/9/1/c8eok39a9/webroots/r510470/butikk157d/includes/templates/responsive_classic/common/html_header.php on line 20.

[17-Apr-2022 14:40:41 UTC] Request URI: /butikk157d/index.php?main_page=product_info&cPath=1&products_id=22, IP address: .
#1 require(/customers/b/9/1/c8eok39a9/webroots/r510470/butikk157d/includes/templates/responsive_classic/templates/tpl_product_info_display.php) called at [/customers/b/9/1/c8eok39a9/webroots/r510470/butikk157d/includes/modules/pages/product_info/main_template_vars.php:153]
#2 require(/customers/b/9/1/c8eok39a9/webroots/r510470/butikk157d/includes/modules/pages/product_info/main_template_vars.php) called at [/customers/b/9/1/c8eok39a9/webroots/r510470/butikk157d/includes/templates/responsive_classic/common/tpl_main_page.php:178]
#3 require(/customers/b/9/1/c8eok39a9/webroots/r510470/butikk157d/includes/templates/responsive_classic/common/tpl_main_page.php) called at [/customers/b/9/1/c8eok39a9/webroots/r510470/butikk157d/index.php:94]
--> PHP Warning: Use of undefined constant BUTTON_IMAGE_ASK_A_QUESTION - assumed 'BUTTON_IMAGE_ASK_A_QUESTION' (this will throw an Error in a future version of PHP) in /customers/b/9/1/c8eok39a9/webroots/r510470/butikk157d/includes/templates/responsive_classic/templates/tpl_product_info_display.php on line 94.

[17-Apr-2022 14:40:41 UTC] Request URI: /butikk157d/index.php?main_page=product_info&cPath=1&products_id=22, IP address: .
#1 require(/customers/b/9/1/c8eok39a9/webroots/r510470/butikk157d/includes/templates/responsive_classic/templates/tpl_product_info_display.php) called at [/customers/b/9/1/c8eok39a9/webroots/r510470/butikk157d/includes/modules/pages/product_info/main_template_vars.php:153]
#2 require(/customers/b/9/1/c8eok39a9/webroots/r510470/butikk157d/includes/modules/pages/product_info/main_template_vars.php) called at [/customers/b/9/1/c8eok39a9/webroots/r510470/butikk157d/includes/templates/responsive_classic/common/tpl_main_page.php:178]
#3 require(/customers/b/9/1/c8eok39a9/webroots/r510470/butikk157d/includes/templates/responsive_classic/common/tpl_main_page.php) called at [/customers/b/9/1/c8eok39a9/webroots/r510470/butikk157d/index.php:94]
--> PHP Warning: Use of undefined constant BUTTON_ASK_A_QUESTION_ALT - assumed 'BUTTON_ASK_A_QUESTION_ALT' (this will throw an Error in a future version of PHP) in /customers/b/9/1/c8eok39a9/webroots/r510470/butikk157d/includes/templates/responsive_classic/templates/tpl_product_info_display.php on line 94.

[17-Apr-2022 14:40:41 UTC] Request URI: /butikk157d/index.php?main_page=product_info&cPath=1&products_id=22, IP address: .
#1 require(/customers/b/9/1/c8eok39a9/webroots/r510470/butikk157d/includes/templates/responsive_classic/templates/tpl_product_info_display.php) called at [/customers/b/9/1/c8eok39a9/webroots/r510470/butikk157d/includes/modules/pages/product_info/main_template_vars.php:153]
#2 require(/customers/b/9/1/c8eok39a9/webroots/r510470/butikk157d/includes/modules/pages/product_info/main_template_vars.php) called at [/customers/b/9/1/c8eok39a9/webroots/r510470/butikk157d/includes/templates/responsive_classic/common/tpl_main_page.php:178]
#3 require(/customers/b/9/1/c8eok39a9/webroots/r510470/butikk157d/includes/templates/responsive_classic/common/tpl_main_page.php) called at [/customers/b/9/1/c8eok39a9/webroots/r510470/butikk157d/index.php:94]
--> PHP Warning: Use of undefined constant ARIA_QTY_ADD_TO_CART - assumed 'ARIA_QTY_ADD_TO_CART' (this will throw an Error in a future version of PHP) in /customers/b/9/1/c8eok39a9/webroots/r510470/butikk157d/includes/templates/responsive_classic/templates/tpl_product_info_display.php on line 164.

I'm not too experienced with php and mysql, I hope somebody will look into this as I'm stuck after searching all around for solutions.

Geir

https://osteroy-sogelag.org/butikk157d
Zencart 1.5.7d
PHP: 7.4.29

17 Apr 2022, 16:14
#2
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,065
Plugin Contributions:
56

Re: Upgrading from 1.55e to 1.57d - problems with language files

For that "headers already sent" issue, check that the /includes/languages/norwegian.php doesn't have an ending** ?>** with one or more blank lines following. If so, simply remove that ?>, leaving only a single blank line after all the definitions.

17 Apr 2022, 17:02
#3
ormhaugen avatar

ormhaugen

New Zenner

Join Date:
Apr 2009
Posts:
32
Plugin Contributions:
0

Re: Upgrading from 1.55e to 1.57d - problems with language files

Thanks for the tip. Checked that, but it's OK, no ?> at the end of the file.
But after posting, I found that the file should be saved without BOM. That seems to prevent a blank page, but still no normal shopping cart.
1: PHP Warning: Use of undefined constant. How do I cope with this problem?
2. Alle requires: How do I fix these issues?
Geir

18 Apr 2022, 19:04
#4
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,065
Plugin Contributions:
56

Re: Upgrading from 1.55e to 1.57d - problems with language files

Ormhaugen:

Thanks for the tip. Checked that, but it's OK, no ?> at the end of the file.
But after posting, I found that the file should be saved without BOM. That seems to prevent a blank page, but still no normal shopping cart.
1: PHP Warning: Use of undefined constant. How do I cope with this problem?
2. Alle requires: How do I fix these issues?
Geir
Use a file/directory comparison tool (like Beyond Compare) and compare the norwegian language-directory's files to those distributed with zc157d. While the language-specific value will be different, that will let you know what definitions are missing from the norwegian files and also what definitions are no longer used.

19 Apr 2022, 11:24
#5
ormhaugen avatar

ormhaugen

New Zenner

Join Date:
Apr 2009
Posts:
32
Plugin Contributions:
0

Re: Upgrading from 1.55e to 1.57d - problems with language files

Thanks for help.
Found two files missing in my old language pack. Shopping cart working when copying the to the shop.
But still have som requires, like this:
#1 require(/customers/b/9/1/c8eok39a9/webroots/xxxxxxxx/butikk157d/braWn-LNR-cameL/includes/javascript_loader.php) called at [/customers/b/9/1/c8eok39a9/webroots/r510470/butikk157d/braWn-LNR-cameL/includes/admin_html_head.php:66]

How do I correct this? That is: how do I set up the right path to the referred file?
Geir

19 Apr 2022, 12:17
#6
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,065
Plugin Contributions:
56

Re: Upgrading from 1.55e to 1.57d - problems with language files

Ormhaugen:

Thanks for help.
Found two files missing in my old language pack. Shopping cart working when copying the to the shop.
But still have som requires, like this:
#1 require(/customers/b/9/1/c8eok39a9/webroots/xxxxxxxx/butikk157d/braWn-LNR-cameL/includes/javascript_loader.php) called at [/customers/b/9/1/c8eok39a9/webroots/r510470/butikk157d/braWn-LNR-cameL/includes/admin_html_head.php:66]

How do I correct this? That is: how do I set up the right path to the referred file?
Geir
You're missing that file from the zc157 distribution. Ensure that it's been included ... and change the name of your admin directory.

19 Apr 2022, 13:29
#7
ormhaugen avatar

ormhaugen

New Zenner

Join Date:
Apr 2009
Posts:
32
Plugin Contributions:
0

Re: Upgrading from 1.55e to 1.57d - problems with language files

The file 'javascript_loader.php' is present in the admin/includes folder.
It's referred to like this in 'admin_html_head.php': require(DIR_WS_INCLUDES . 'javascript_loader.php');
I can't get this right. As far as I can see, it should be OK. But ZC reports it.
Is there something wrong with the path in the 'admin_html_head.php' ?
Publicly showing the admin directory wasn't too smart, - changed. Thanks.
Geir

19 Apr 2022, 14:51
#8
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,065
Plugin Contributions:
56

Re: Upgrading from 1.55e to 1.57d - problems with language files

Could you post the full contents of that log ... after xxx-ing out the admin directory name?

19 Apr 2022, 17:07
#9
ormhaugen avatar

ormhaugen

New Zenner

Join Date:
Apr 2009
Posts:
32
Plugin Contributions:
0

Re: Upgrading from 1.55e to 1.57d - problems with language files

I don't have that log anymore, but enclosing a similar log with a lot of requires from the shop catalog (not admin). I've chosen 4 examples showing different references. I have checked that the files required really are present on the server, no files missing.
I still can't see why ZC is reporting those requires.

[19-Apr-2022 15:38:54 UTC] Request URI: /xxxxxxxx/index.php?main_page=product_info&cPath=3&products_id=61, IP address: .

#1 require(/customers/b/9/1/zzzzzzzz/webroots/r510470/xxxxxxxx/includes/templates/responsive_classic/templates/tpl_products_next_previous.php) called at [/customers/b/9/1/zzzzzzzz/webroots/r510470/xxxxxxxx/includes/templates/responsive_classic/templates/tpl_product_info_display.php:196]
Referred like this in tpl_product_info_display.php:196:
require($template->get_template_dir('/tpl_products_next_previous.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_products_next_previous.php'); ?>

#2 require(/customers/b/9/1/zzzzzzzz/webroots/r510470/xxxxxxxx/includes/templates/responsive_classic/templates/tpl_product_info_display.php) called at [/customers/b/9/1/zzzzzzzz/webroots/r510470/xxxxxxxx/includes/modules/pages/product_info/main_template_vars.php:153]
Referred like this in main_template_vars.php:153:
require($template->get_template_dir($tpl_page_body,DIR_WS_TEMPLATE, $current_page_base,'templates'). $tpl_page_body);

#3 require(/customers/b/9/1/zzzzzzzz/webroots/r510470/xxxxxxxx/includes/modules/pages/product_info/main_template_vars.php) called at [/customers/b/9/1/zzzzzzzz/webroots/r510470/xxxxxxxx/includes/templates/responsive_classic/common/tpl_main_page.php:178]
Referred like this in tpl_main_page.php:178
require($body_code);

#4 require(/customers/b/9/1/zzzzzzzz/webroots/r510470/xxxxxxxx/includes/templates/responsive_classic/common/tpl_main_page.php) called at [/customers/b/9/1/zzzzzzzz/webroots/r510470/xxxxxxxx/index.php:94]
Referred like this in index.php:94:
require($template->get_template_dir('tpl_main_page.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/tpl_main_page.php');

19 Apr 2022, 17:49
#10
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,065
Plugin Contributions:
56

Re: Upgrading from 1.55e to 1.57d - problems with language files

That's not the full log:(; a log normally contains a backtrace of who-called-who as well as a PHP notice/warning/error code.

19 Apr 2022, 19:31
#11
ormhaugen avatar

ormhaugen

New Zenner

Join Date:
Apr 2009
Posts:
32
Plugin Contributions:
0

Re: Upgrading from 1.55e to 1.57d - problems with language files

Here comes one of the logs showing several requires.

[19-Apr-2022 17:09:01 UTC] Request URI: /butikk157d/xxxxxxxx/index.php?cmd=modules&set=ordertotal, IP address: .
#1 header() called at [/customers/b/9/1/zzzzzzz/webroots/r510470/butikk157d/xxxxxxxx/includes/init_includes/init_templates.php:27]
#2 require_once(/customers/b/9/1/zzzzzzz/webroots/r510470/butikk157d/xxxxxxxx/includes/init_includes/init_templates.php) called at [/customers/b/9/1/zzzzzzz/webroots/r510470/butikk157d/includes/autoload_func.php:37]
#3 require(/customers/b/9/1/zzzzzzz/webroots/r510470/butikk157d/includes/autoload_func.php) called at [/customers/b/9/1/zzzzzzz/webroots/r510470/butikk157d/xxxxxxxx/includes/application_top.php:37]
#4 require(/customers/b/9/1/zzzzzzz/webroots/r510470/butikk157d/xxxxxxxx/includes/application_top.php) called at [/customers/b/9/1/zzzzzzz/webroots/r510470/butikk157d/xxxxxxxx/modules.php:8]
#5 require(/customers/b/9/1/zzzzzzz/webroots/r510470/butikk157d/xxxxxxxx/modules.php) called at [/customers/b/9/1/zzzzzzz/webroots/r510470/butikk157d/xxxxxxxx/index.php:11]
--> PHP Warning: Cannot modify header information - headers already sent by (output started at /customers/b/9/1/zzzzzzz/webroots/r510470/butikk157d/xxxxxxxx/includes/languages/norwegian/modules.php:1) in /customers/b/9/1/zzzzzzz/webroots/r510470/butikk157d/xxxxxxxx/includes/init_includes/init_templates.php on line 27.

What do you get of it?
Geir

20 Apr 2022, 12:03
#12
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,065
Plugin Contributions:
56

Re: Upgrading from 1.55e to 1.57d - problems with language files

Ormhaugen:

Here comes one of the logs showing several requires.

[19-Apr-2022 17:09:01 UTC] Request URI: /butikk157d/xxxxxxxx/index.php?cmd=modules&set=ordertotal, IP address: .
#1 header() called at [/customers/b/9/1/zzzzzzz/webroots/r510470/butikk157d/xxxxxxxx/includes/init_includes/init_templates.php:27]
#2 require_once(/customers/b/9/1/zzzzzzz/webroots/r510470/butikk157d/xxxxxxxx/includes/init_includes/init_templates.php) called at [/customers/b/9/1/zzzzzzz/webroots/r510470/butikk157d/includes/autoload_func.php:37]
#3 require(/customers/b/9/1/zzzzzzz/webroots/r510470/butikk157d/includes/autoload_func.php) called at [/customers/b/9/1/zzzzzzz/webroots/r510470/butikk157d/xxxxxxxx/includes/application_top.php:37]
#4 require(/customers/b/9/1/zzzzzzz/webroots/r510470/butikk157d/xxxxxxxx/includes/application_top.php) called at [/customers/b/9/1/zzzzzzz/webroots/r510470/butikk157d/xxxxxxxx/modules.php:8]
#5 require(/customers/b/9/1/zzzzzzz/webroots/r510470/butikk157d/xxxxxxxx/modules.php) called at [/customers/b/9/1/zzzzzzz/webroots/r510470/butikk157d/xxxxxxxx/index.php:11]
-->** PHP Warning: Cannot modify header information - headers already sent** by (output started at /customers/b/9/1/zzzzzzz/webroots/r510470/butikk157d/xxxxxxxx/includes/languages/norwegian/modules.php:1) in /customers/b/9/1/zzzzzzz/webroots/r510470/butikk157d/xxxxxxxx/includes/init_includes/init_templates.php on line 27.

What do you get of it?
Geir
That's telling me that you need to inspect the file /customers/b/9/1/zzzzzzz/webroots/r510470/butikk157d/xxxxxxxx/includes/languages/norwegian/modules.php to see for the possible issues I identified in post #2 of this thread and/or whether the file uses UTF-8+BOM instead of simply UTF-8 as its encoding.

20 Apr 2022, 16:14
#13
ormhaugen avatar

ormhaugen

New Zenner

Join Date:
Apr 2009
Posts:
32
Plugin Contributions:
0

Re: Upgrading from 1.55e to 1.57d - problems with language files

OK, checked that, should be OK now. Thanks again.
The shop is now working OK, and I have both admin and the shop in norwegian.
But what about the requires? How should I get the correct paths to the referred files?
Geir

21 Apr 2022, 10:49
#14
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Upgrading from 1.55e to 1.57d - problems with language files

Ormhaugen:

OK, checked that, should be OK now. Thanks again.
The shop is now working OK, and I have both admin and the shop in norwegian.
But what about the requires? How should I get the correct paths to the referred files?
Geir

What do you mean about an issue with requires? If there is a problem causing an issue to be reported, there should be a log generated that gives information very much like what has been posted recently. There should be one or more rows of data starting with a hash tag followed by a number leading to an explanation of what the issue is.

Like identified above, the list started with #1 and the last was#5, in that last entry, the statement was made about headers already being sent. Clearing the headers portion should eliminate the generation of that log.

If the confusion is coming from the information provided in that log, note that the log is identifying the code sections involved with getting to the error. Roughly what the above shows is that when accessing the admin's modules file, it loaded the application_top file, which loaded the autoloas_func file which loaded the init_templates file which sent a request to push information to the header. The problem though is(was) that header information had already been sent at a point in processing before that request. As identified in the log at the bottom, that additional header information has been sent from the language file. Based on a previous post of this thread, more than likely that admin language file also had BOM (byte order mark) information. But I can only guess on that. For all to really know, the issue and fix should be identified by someone that found and or corrected the issue.

21 Apr 2022, 16:41
#15
ormhaugen avatar

ormhaugen

New Zenner

Join Date:
Apr 2009
Posts:
32
Plugin Contributions:
0

Re: Upgrading from 1.55e to 1.57d - problems with language files

It now seems to be sorted. After saving files in question with NO BOM, I don't get logs any more, - at least so far...
Thanks for your help.
Geir