Post by jmark » Thu May 07, 2009 8:29 pm

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

Newbie

Posts

Joined
Tue May 05, 2009 5:15 pm

Post by Daniel » Thu May 07, 2009 8:45 pm

When you add a new language you need to go over every multi language page and add information.

User avatar
Administrator

Posts

Joined
Fri Nov 03, 2006 6:57 pm

Post by jmark » Thu May 07, 2009 9:33 pm

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.

Newbie

Posts

Joined
Tue May 05, 2009 5:15 pm

Post by Qphoria » Thu May 07, 2009 10:23 pm

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.

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by baris22 » Thu May 07, 2009 10:29 pm

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.

Newbie

Posts

Joined
Sat Jan 05, 2008 9:03 pm

Post by jmark » Thu May 07, 2009 10:36 pm

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.

Newbie

Posts

Joined
Tue May 05, 2009 5:15 pm

Post by Daniel » Fri May 08, 2009 7:53 am

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

User avatar
Administrator

Posts

Joined
Fri Nov 03, 2006 6:57 pm

Post by jmark » Fri May 08, 2009 6:47 pm

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

Newbie

Posts

Joined
Tue May 05, 2009 5:15 pm

Post by jmark » Mon May 25, 2009 9:20 pm

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

Newbie

Posts

Joined
Tue May 05, 2009 5:15 pm

Post by Daniel » Mon May 25, 2009 9:38 pm

its correct!

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

User avatar
Administrator

Posts

Joined
Fri Nov 03, 2006 6:57 pm
Who is online

Users browsing this forum: No registered users and 4 guests