Skip to content

Conversation

@bchatard
Copy link
Contributor

@bchatard bchatard commented Apr 7, 2016

Escape confirmRemoveMessage on wishlist view

Exampe in French: Êtes-vous sûr de vouloir supprimer cet article de votre liste d'envie ==> Êtes-vous sûr de vouloir supprimer cet article de votre liste d'envie

@slavvka
Copy link
Member

slavvka commented Apr 8, 2016

Hi @bchatard. Could you please tell me how did you manage to see this message as it isn't used in JS code?

@bchatard
Copy link
Contributor Author

bchatard commented Apr 8, 2016

In Wish List view (http://my-site.com/wishlist/index/index/wishlist_id/{wishlist_id}/

There is a form (#wishlist-view-form) which have an attribute data-mage-init. This attribute contain this (in English)

data-mage-init='{"wishlist":{
          "addToCartUrl":{"action":"http:\/\/my-site.com\/wishlist\/index\/cart\/","data":{"item":"%item%","uenc":"aHR0cDovL3NhbmRib3gubWFnZW50bzIuZGV2L3dpc2hsaXN0L2luZGV4L2luZGV4L3dpc2hsaXN0X2lkLzEv"}},
          "confirmRemoveMessage":"Are you sure you want to remove this product from your Wish List?",
          "addAllToCartUrl":{"action":"http:\/\/my-site.com\/wishlist\/index\/allcart\/","data":{"wishlist_id":"1","uenc":"aHR0cDovL3NhbmRib3gubWFnZW50bzIuZGV2L3dpc2hsaXN0L2luZGV4L2luZGV4L3dpc2hsaXN0X2lkLzEv"}},
          "commentString":""},
          "validation": {}}'

But if the field confirmRemoveMessage contain a ' the JSON is not valid.
The page is not fully loaded (missing dynamic block on left) and the following javascript error is thrown
image

data-mage-init='{"wishlist":{
          "addToCartUrl":{"action":"http:\/\/my-site.com\/wishlist\/index\/cart\/","data":{"item":"%item%","uenc":"aHR0cDovL3NhbmRib3gubWFnZW50bzIuZGV2L3dpc2hsaXN0L2luZGV4L2luZGV4L3dpc2hsaXN0X2lkLzEv"}},
          "confirmRemoveMessage":"Êtes-vous sûr de vouloir supprimer cet article de votre liste d'envie",
          "addAllToCartUrl":{"action":"http:\/\/my-site.com\/wishlist\/index\/allcart\/","data":{"wishlist_id":"1","uenc":"aHR0cDovL3NhbmRib3gubWFnZW50bzIuZGV2L3dpc2hsaXN0L2luZGV4L2luZGV4L3dpc2hsaXN0X2lkLzEv"}},
          "commentString":""},
          "validation": {}}'

@slavvka
Copy link
Member

slavvka commented May 14, 2016

Hi @bchatard, Thank you for your contribution but your PR has been declined since mentioned string isn't used anymore so it has been removed. See 0b5292.

@slavvka slavvka closed this May 14, 2016
@bchatard bchatard deleted the wishlist_escape_js_quote branch May 14, 2016 22:19
magento-engcom-team pushed a commit that referenced this pull request Apr 18, 2019
Fixed issues:
- MAGETWO-97585 Build Results Unification. Part 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants