JS Error on Product Comparison page - on local XAMPP development environment - caused by code on this module [with code solution] #5
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gh-thirtybees/socialsharing#5
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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:
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 :)
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:

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