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

IBX-7979: Fixed "field" occurrences being wrongly replaced #59

Merged

Conversation

konradoboza
Copy link
Contributor

https://issues.ibexa.co/browse/IBX-7979

Performing simple str_replace on fieldtypes' identifiers like my_custom_field instead of

'@=resolver("MatrixFieldValue", [value, "my_custom_field"])'

produced something like:

@=resolver("MatrixFieldValue", [value, "my_custom_resolver("ItemFieldValue", [value, "' . $fieldDefinition->identifier . '", args])"])

which is obviously an invalid schema entry.

Decided to just narrow down the actual replacing to values not being inside double quotes. The reason for that is that we have several scenarios to be handled like [field], @=field, "@=resolver("Page", [field, context])" etc. where current str_replace needs to be invoked.

@konradoboza konradoboza self-assigned this Mar 18, 2024
@konradoboza konradoboza added Bug Something isn't working Ready for review labels Mar 18, 2024
Copy link

sonarcloud bot commented Mar 18, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@konradoboza konradoboza requested review from a team and bdunogier March 18, 2024 11:17
@alongosz alongosz requested a review from a team March 18, 2024 11:31
@webhdx webhdx requested a review from a team March 18, 2024 11:32
@tomaszszopinski
Copy link

QA approved on IbexaDXP commerce 4.5

@konradoboza konradoboza merged commit d34971b into 4.5 Mar 19, 2024
9 checks passed
@konradoboza konradoboza deleted the ibx-7979-field-keyword-being-too-extensively-replaced branch March 19, 2024 12:36
webhdx added a commit that referenced this pull request Mar 20, 2024
@ITernovtsii
Copy link
Contributor

FYI: this brokes any field with identifier that contains 'content', 'location', 'item',
for example, with field identifier card_items, the generated schema is
resolve: '@=resolver("RelationFieldValue", [resolver("ItemFieldValue", [value, "card_values", args]), true])'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working QA approved
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants