Jump to content

Impossible to get the product page [1.7.4.4]


ludojlm
 Share

Recommended Posts

Hi,

I can't access any of my product pages, I always have an error message that says : Warning: htmlspecialchars() expects parameter 1 to be string, array given

I know what it means, so I tried to check all occurences of htmlspecialchars() in the core in order to find where an array was passed, and changing it in string if possible. I've already done this with the class Link.php.

But I wasn't able to find it, the error doesn't change and I can't find any help on the internet... Does anyone know what to do or at least where to search? Thanks a lot,

erreur.PNG

Share this post


Link to post
Share on other sites

You can disable all external module + Override files from your website for test: https://postimg.cc/0rxsmY1J

Go to Advanced Parameters >> Performance, change

Disable non PrestaShop modules = Yes
Disable all override = Yes

If that error is stopped, so some external modules caused that error. you can STOP each module to check

2.Also please check a module which have file head_seo.tpl, Prestashop warning this file

Share this post


Link to post
Share on other sites

  • 11 months later...
On 1/24/2019 at 10:25 AM, ludojlm said:

Nope, the error is still there. I'm trying to make a new fresh install on a subdomain to see where the problem could be.

Hello,

did you get answer for that?
I am getting same error when trying to call that function from tpl file:
 

{ProductCoreOverride::getFrontFeaturesOverride($js_custom_vars.prestashop.language.id, $product.id_product|string_format:"%d")}

I am sure both my variables are strings.

Share this post


Link to post
Share on other sites

  • 4 months later...
  • 4 months later...

Not sure if this helps anyone but my problem with this error was due to the fact that my variable was null / empty. I had to wrap it in an if ! empty before trying to access it. 

 

{if !empty($variablename)}
	{if $variablename|strpos:"test" !== false}
		<div>Hi</div>
	{/if}
{/if}

 

Share this post


Link to post
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
 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More