Page 1 of 1

Language Bug

Posted: Thu May 07, 2009 8:29 pm
by jmark
Another issue founded.

Try this:
When you are seeing a product description, and if try to change the language on that moment, it receives the following error:
Notice: Undefined index: product_id in ...\upload\catalog\controller\product\product.php on line 69

Notice: Undefined index: product_id in ...\upload\catalog\controller\product\product.php on line 264

Warning: Cannot modify header information - headers already sent by (output started at ...\upload\catalog\controller\product\product.php:69) in ...\upload\system\library\response.php on line 65
The products are in two languages, i've edit the default products for two languages.
I´ve tried with the defaults products like this one:
index.php?route=product/product&product_id=47
Thanks in advance

Re: Language Bug

Posted: Thu May 07, 2009 8:45 pm
by Daniel
When you add a new language you need to go over every multi language page and add information.

Re: Language Bug

Posted: Thu May 07, 2009 9:33 pm
by jmark
Hi Daniel,
thanks for your quick reply, but i didn´t understand what you said. I had all products in two languages, the name and the description. It is that you said?

Thanks.

Re: Language Bug

Posted: Thu May 07, 2009 10:23 pm
by Qphoria
Daniel is right about the languages. You have to add a description for each language your site supports, but it should still never show a php error even if the content for that language isn't there, so that part is a bug.

Re: Language Bug

Posted: Thu May 07, 2009 10:29 pm
by baris22
you get problem if there is a character which is not getting supported.

I had the same problem but it is sorted. I downloaded NOTEPAD++ and opened the file with it. Goto format and set it to encode in utf-8 without bom. edit your language and save. that is it.

Re: Language Bug

Posted: Thu May 07, 2009 10:36 pm
by jmark
Well i found were it does the error.

First i have two languages, the default english ant portugues (ISO-8859-1). All files and all products are translated. What i've check is in the construction of the url.

So, the default language is portugues and navigating thru the categories and products no problem. At one time when decide to change language the error persist.

Default url: index.php?route=product/product&product_id=48

Change language and you see the symbol in iso format:

Url: index.php?route=product/product&product_id=48

As you can see the "amp;" symbolo tht's the same for iso latin "& = &" is translated to the url.

Where i change or this or is this symbol translated?

Thanks in advance.

Re: Language Bug

Posted: Fri May 08, 2009 7:53 am
by Daniel
jmark wrote:Another issue founded.

Try this:
When you are seeing a product description, and if try to change the language on that moment, it receives the following error:
Notice: Undefined index: product_id in ...\upload\catalog\controller\product\product.php on line 69

Notice: Undefined index: product_id in ...\upload\catalog\controller\product\product.php on line 264

Warning: Cannot modify header information - headers already sent by (output started at ...\upload\catalog\controller\product\product.php:69) in ...\upload\system\library\response.php on line 65
The products are in two languages, i've edit the default products for two languages.
I´ve tried with the defaults products like this one:
index.php?route=product/product&product_id=47
Thanks in advance
the errors showing bug will be finisx in v1.2.9

Re: Language Bug

Posted: Fri May 08, 2009 6:47 pm
by jmark
Hi there just passing my experience.

First, for avoid problems language keep the files in utf-8 encoding, like baris22 said. In my mac with xampp, after encoding all files to utf-8, the problem with & do not happens.

Second tried in windows, with xampp, just copie all files from mac to windows and install again and the problem persist.

Should it be some configuration on php.ini or apache? I've compare the files but they are equal..

Now i'm confuse.... ???

Thanks

Re: Language Bug

Posted: Mon May 25, 2009 9:20 pm
by jmark
Hi there,
again with the language url bug. This is my fix for the & separator.
Debugging thru the opencart i found that in the class Url the str_replace function is not correct. Daniel check this please:

Original:

Code: Select all

        public function http($route) {
		return HTTP_SERVER . 'index.php?route=' . str_replace('&', '&', $route);
  	}

  	public function https($route) {
		if (HTTPS_SERVER != '') {
	  		$link = HTTPS_SERVER . 'index.php?route=' . str_replace('&', '&', $route);
		} else {
	  		$link = HTTP_SERVER . 'index.php?route=' . str_replace('&', '&', $route);
		}
				
		return $link;
  	}
Fix:

Code: Select all

       public function http($route) {
		return HTTP_SERVER . 'index.php?route=' . str_replace('&', '&', $route);
  	}

  	public function https($route) {
		if (HTTPS_SERVER != '') {
	  		$link = HTTPS_SERVER . 'index.php?route=' . str_replace('&', '&', $route);
		} else {
	  		$link = HTTP_SERVER . 'index.php?route=' . str_replace('&', '&', $route);
		}
				
		return $link;
  	}
Thanks to all. ;D

Re: Language Bug

Posted: Mon May 25, 2009 9:38 pm
by Daniel
its correct!

your pages will not validate w3c if you have the & in them.