Jump to content

Notice: Array to string conversion in .../classes/Link on line 408 presta 1.6.0.13


Recommended Posts

I getting this error on any product page:

 

Notice: Array to string conversion in .../classes/Link on line 408
// legacy mode or default image
		$theme = ((Shop::isFeatureActive() && file_exists(_PS_PROD_IMG_DIR_.$ids.($type ? '-'.$type : '').'-'.(int)Context::getContext()->shop->id_theme.'.jpg')) ? '-'.Context::getContext()->shop->id_theme : '');
		if ((Configuration::get('PS_LEGACY_IMAGES')
			&& (file_exists(_PS_PROD_IMG_DIR_.$ids.($type ? '-'.$type : '').$theme.'.jpg')))
			|| ($not_default = strpos($ids, 'default') !== false))
		{
			if ($this->allow == 1 && !$not_default)
				$uri_path = __PS_BASE_URI__.$ids.($type ? '-'.$type : '').$theme.'/'.$name.'.jpg';
			else
				$uri_path = _THEME_PROD_DIR_.$ids.($type ? '-'.$type : '').$theme.'.jpg';
		}
		else
		{
			// if ids if of the form id_product-id_image, we want to extract the id_image part
			$split_ids = explode('-', $ids);
			$id_image = (isset($split_ids[1]) ? $split_ids[1] : $split_ids[0]);
			$theme = ((Shop::isFeatureActive() && file_exists(_PS_PROD_IMG_DIR_.Image::getImgFolderStatic($id_image).$id_image.($type ? '-'.$type : '').'-'.(int)Context::getContext()->shop->id_theme.'.jpg')) ? '-'.Context::getContext()->shop->id_theme : '');
			if ($this->allow == 1)
408			$uri_path = __PS_BASE_URI__.$id_image.($type ? '-'.$type : '').$theme.'/'.$name.'.jpg';
			else
				$uri_path = _THEME_PROD_DIR_.Image::getImgFolderStatic($id_image).$id_image.($type ? '-'.$type : '').$theme.'.jpg';
		}

		return $this->protocol_content.Tools::getMediaServer($uri_path).$uri_path;
	}

	public function getMediaLink($filepath)
	{
		return $this->protocol_content.Tools::getMediaServer($filepath).$filepath;
	}

any idea  hat is worng??

Edited by zabamich (see edit history)
Link to comment
Share on other sites

  • 2 years later...

I have used var_dump() function for each variable such as $id_image$type, $theme or $name.

 

Then going to check my web page and its getting below type.

 

/var/www/html/prestashop/classes/Link.php:406:string '20001' (length=5)
/var/www/html/prestashop/classes/Link.php:408:string '' (length=0)
/var/www/html/prestashop/classes/Link.php:410:string 'small_default' (length=13)
*/var/www/html/prestashop//classes/Link.php:412:string '/shop/img/p/2/0/0/0/1/20001-small_default.jpg' (length=45)

 

 

Please give me any idea regarding this notice error.

Edited by kirubanidhi (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...