Skip to content

Apostrophe in attribute option value in admin is not handled properly #12127

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

Closed
erfanimani opened this issue Nov 9, 2017 · 4 comments
Closed
Labels
Fixed in 2.2.x The issue has been fixed in 2.2 release line Fixed in 2.3.x The issue has been fixed in 2.3 release line Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release

Comments

@erfanimani
Copy link
Contributor

erfanimani commented Nov 9, 2017

Preconditions

  1. Magento 2.1 and 2.2
  2. Chrome 62

Steps to reproduce

  1. As an admin, go to Stores -> Attributes -> Products -> Manufacturer
  2. Add a new attribute option called "Nature's Way Supplements"
  3. Hit "Save and continue"
  4. Hit "Save and continue" again

Expected result

  1. In the admin, the attribute option value text input should say "Nature's Way Supplements"
  2. If you check the value in the database, it should be "Nature's Way Supplements"

Actual result

  1. The text input says: Nature's Way Supplements
  2. The database entry says: Nature's Way Supplements

After the first time of saving, the database looks alright, but the input value is wrong. This causes another save not to be idempotent. The bad escape causes side-effects, and this causes all sorts of issues — double escaping, imports not running because now the attribute options don't match up, and so on.

If that's not convincing, storing HTML escaped values int the database is clearly wrong — it should only be escaped if outputted to a web page, the database entry should be as close to the original user input as possible.

Couple other people are complaining about this on Stackexchange, i.e. https://magento.stackexchange.com/questions/198673/magento-2-cant-store-apostrophe-in-manufacturer-options

@magento-engcom-team magento-engcom-team added Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed labels Nov 9, 2017
@erfanimani
Copy link
Contributor Author

I've added a pull request here: #12133

@magento-engcom-team
Copy link
Contributor

@erfanimani, thank you for your report.
We've created internal ticket(s) MAGETWO-83519 to track progress on the issue.

@magento-engcom-team magento-engcom-team added 2.1.x Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release labels Nov 9, 2017
@okorshenko
Copy link
Contributor

The issue has been fixed and delivered to 2.2-develop branch. Will be available with upcoming patch release

@okorshenko okorshenko added the Fixed in 2.2.x The issue has been fixed in 2.2 release line label Nov 28, 2017
@magento-engcom-team
Copy link
Contributor

Hi @erfanimani. Thank you for your report.
The issue has been fixed in magento-engcom/magento2ce#1361 by @magento-engcom-team in 2.3-develop branch
Related commit(s):

The fix will be available with the upcoming 2.3.0 release.

@magento-engcom-team magento-engcom-team added the Fixed in 2.3.x The issue has been fixed in 2.3 release line label Feb 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fixed in 2.2.x The issue has been fixed in 2.2 release line Fixed in 2.3.x The issue has been fixed in 2.3 release line Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release
Projects
None yet
Development

No branches or pull requests

3 participants