Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JS Error on Product Comparison page - on local XAMPP development environment - caused by code on this module [with code solution] #5

Closed
Acer-ZA opened this issue Sep 16, 2019 · 2 comments
Labels

Comments

@Acer-ZA
Copy link

Acer-ZA commented Sep 16, 2019

On TB 1.1.0, local XAMPP development environment:
Product Comparison page throws the following JS errors, causing "removing product from column" to not work:

Uncaught Syntax Error: Invalid Hexadecimal escape sequence 
Uncaught Reference Error: baseUri is not defined

Problem is solved by making the following code change in
/modules/socialsharing/socialsharing.php line 243

change

_PS_IMG_DIR_.Configuration::get('PS_LOGO_MAIL', null, null, $this->context->shop->id), "'"
into
str_replace("\\","/",_PS_IMG_DIR_).Configuration::get('PS_LOGO_MAIL', null, null, $this->context->shop->id), "'"

Related TB Forum Post:
https://forum.thirtybees.com/topic/3466-solved-product-comparison-error-when-trying-to-remove-product-30bz-110-local-dev-xampp/

As this is one of my first issue posts, please point out any issues or improvements that I can make on future issue posts. Thanks :)

@musicpanda
Copy link

musicpanda commented Sep 20, 2019

You have to wonder whether the problem here really is Windows. It is highly unusual (and considered a bit of a security risk) to expose the full path on the server in the code that is served to the customers. That is one of the reasons why we don't display error messages unless in debug mode. A javascript file is less visible but one still has to wonder why.

This may not be a problem with cloud servers. In the TB demo the js file looks like this:
sharing

This is an error that also happens in Prestashop 1.6. In Prestashop 1.7 the compare function seems to have disappeared.

@getdatakick
Copy link
Contributor

fixed by 736acf8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants