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

Special chars in attribute names break feed settings #93

Closed
bissie opened this issue Jan 11, 2022 · 8 comments
Closed

Special chars in attribute names break feed settings #93

bissie opened this issue Jan 11, 2022 · 8 comments

Comments

@bissie
Copy link

bissie commented Jan 11, 2022

Customer had an attribute with Title Shopattribute "New"
When open module setting page section feed settings, adding a new attribute is not possible and stored attributes are not displayed.
Quotation marks in titles destroy json structure.
Steps to reproduce:

  • Create an attribute with Quotation marks in Title
  • Open settings page for oxid module
@a-laurowski
Copy link
Contributor

Hi @bissie and thanks for reporting.
This is going to be fixed in next release

@m-schiewi
Copy link

Issue not fixed in 4.1.0

steps to reproduce:

  • create an attribute in shop titled "Webhop Label '%'"
  • insert line console.log(newValue) after attribute-rows.js:41
  • notice that string newValue ends like ".... Webshop Label " leaving out the percentage char and any characters following, consequently any attempt for JSON.parse() fails

-root cause can be found in views/admin/blocks/factfinder_config_field_attributes.tpl:5
[{$availableAttributes|@json_encode}] itself gives valid json but since the fact, that it's enclosed in single quotation like
available-attributes='[{$availableAttributes|@json_encode}]' it fails immedeately if $availableAttributes contains any quotation mark.

@a-laurowski
Copy link
Contributor

hi @m-schiewi
thanks for noticing that. It looks that smarty @json_encode does not properly encode that characters like " and ' and we need to use regular json_encode function with additional encoding flags before assigning to a template variable. This will be fixed in next release.

The 4.1.0 is not yet released. Currently is postponed as we are waiting for the WebComponents v4.0.7 to be released before.

@a-laurowski
Copy link
Contributor

a-laurowski commented Feb 10, 2022

hi @m-schiewi additional encoding is already in master.
4209dc4
With that fix, the attribute names containing apostrophes or quotes should not break the attribute rows component.
image
Version v4.1.0 will be released soon

@m-schiewi
Copy link

@a-laurowski I am confused: 4.1.0 is listed at packagist and installed on my side...
grafik

@a-laurowski
Copy link
Contributor

a-laurowski commented Feb 11, 2022

hi @m-schiewi
the problem here is we already pushed the v4.1.0 tag on Wednesday because we were about to release but then, we postpone that. But since tag was already in repository it was automatically loaded by packagist. if you checked the release lists on github you would notice though, that last official release was 4.0.2, and v4.1.0 was still a draft, not visible as official release.
Sorry for inconvenience.
I will update you as soon as release is out

@m-schiewi
Copy link

thanks a lot!

@a-laurowski
Copy link
Contributor

@m-schiewi the v4.1.0 is out https://github.com/FACT-Finder-Web-Components/oxid-eshop-module/releases/tag/v4.1.0

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

No branches or pull requests

3 participants