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

Unable to insert widget with text value which contains }} string #29006

Merged
merged 13 commits into from
Sep 10, 2020

Conversation

engcom-Kilo
Copy link
Contributor

@engcom-Kilo engcom-Kilo commented Jul 6, 2020

Description (*)

Related Pull Requests

Fixed Issues (if relevant)

  1. Fixes Unable to insert widget with text value which contains }} string #12087

Manual testing scenarios (*)

  1. Go to admin Content -> Pages
  2. Click Add New Page
  3. Set Page Title to Page Title
  4. Expand Content section
  5. In the content field, click Insert Widget button
  6. Choose any widget which has at least one text input, e.g. Catalog Products List
  7. Set widget title: Title}}
  8. Click Insert Widget
  9. Click Save Page
  10. Go in frontend to see the page: /page-title
  11. Make sure that on page exist Widget with title "Title}}"

Questions or comments

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds are green)

@m2-assistant
Copy link

m2-assistant bot commented Jul 6, 2020

Hi @engcom-Kilo. Thank you for your contribution
Here is some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento give me test instance - deploy test instance based on PR changes
  • @magento give me 2.4-develop instance - deploy vanilla Magento instance

❗ Automated tests can be triggered manually with an appropriate comment:

  • @magento run all tests - run or re-run all required tests against the PR changes
  • @magento run <test-build(s)> - run or re-run specific test build(s)
    For example: @magento run Unit Tests

<test-build(s)> is a comma-separated list of build names. Allowed build names are:

  1. Database Compare
  2. Functional Tests CE
  3. Functional Tests EE,
  4. Functional Tests B2B
  5. Integration Tests
  6. Magento Health Index
  7. Sample Data Tests CE
  8. Sample Data Tests EE
  9. Sample Data Tests B2B
  10. Static Tests
  11. Unit Tests
  12. WebAPI Tests

You can find more information about the builds here

ℹ️ Please run only needed test builds instead of all when developing. Please run all test builds before sending your PR for review.

For more details, please, review the Magento Contributor Guide documentation.

@engcom-Kilo
Copy link
Contributor Author

@magento run all tests

@engcom-Kilo
Copy link
Contributor Author

@magento run Static Tests

@engcom-Kilo
Copy link
Contributor Author

@magento run Static Tests

@engcom-Kilo
Copy link
Contributor Author

@magento run all tests

@sidolov sidolov added Priority: P1 Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing. Severity: S2 Major restrictions or short-term circumventions are required until a fix is available. labels Aug 13, 2020
@gabrieldagama gabrieldagama self-assigned this Aug 14, 2020
Copy link
Contributor

@gabrieldagama gabrieldagama left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @engcom-Kilo, thanks for the pull request, it looks good! Please follow a small comments on it. Also, can we cover it with MFTF tests?

Thanks!

app/code/Magento/Widget/Model/Widget.php Outdated Show resolved Hide resolved
@ghost ghost moved this from Pending Review to Changes Requested in Pull Requests Dashboard Aug 19, 2020
app/code/Magento/Widget/Model/Widget.php Outdated Show resolved Hide resolved
app/code/Magento/Widget/Model/Widget.php Outdated Show resolved Hide resolved
app/code/Magento/Widget/Model/Widget.php Outdated Show resolved Hide resolved
app/code/Magento/Widget/Block/Adminhtml/Widget/Options.php Outdated Show resolved Hide resolved
app/code/Magento/Widget/Model/Widget.php Outdated Show resolved Hide resolved
@engcom-Charlie engcom-Charlie self-assigned this Aug 27, 2020
@engcom-Charlie
Copy link
Contributor

@magento run all tests

Copy link
Contributor

@gabrieldagama gabrieldagama left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @engcom-Charlie, thanks for the updates here, it looks good! Pleases follow some small comments below, also, can you cover this PR with tests?

Thanks!

@@ -131,7 +143,7 @@ public function getWidgetByClassType($type)
*/
public function getConfigAsXml($type)
{
return $this->getXmlElementByType($type);
return $this->getWidgetByClassType($type);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems BIC, changing the return type from null|\Magento\Framework\Simplexml\Element to null|array

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gabrieldagama I changed getXmlElementByType to getWidgetByClassType because such i found in obsolete_methods.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the getWidgetByClassType is really a substitute for getXmlElementByType let's create a new method and deprecate the old one.

app/code/Magento/Widget/Model/Widget.php Outdated Show resolved Hide resolved
@engcom-Charlie
Copy link
Contributor

@magento run all tests

@engcom-Charlie
Copy link
Contributor

@magento run all tests

@ghost ghost moved this from Review in Progress to Ready for Testing in Pull Requests Dashboard Sep 10, 2020
@magento-engcom-team
Copy link
Contributor

Hi @gabrieldagama, thank you for the review.
ENGCOM-8132 has been created to process this Pull Request
✳️ @gabrieldagama, could you please add one of the following labels to the Pull Request?

Label Description
Auto-Tests: Covered All changes in Pull Request is covered by auto-tests
Auto-Tests: Not Covered Changes in Pull Request requires coverage by auto-tests
Auto-Tests: Not Required Changes in Pull Request does not require coverage by auto-tests

@engcom-Alfa engcom-Alfa moved this from Ready for Testing to Testing in Progress in Pull Requests Dashboard Sep 10, 2020
@engcom-Alfa engcom-Alfa added the Auto-Tests: Covered All changes in Pull Request is covered by auto-tests label Sep 10, 2020
@engcom-Alfa
Copy link
Contributor

✔️ QA Passed

widget title: Title}}

After: ✔️ The Widget with the title "Title}}" exists on the page

Screenshot from 2020-09-10 14-32-51

widget title: {{Title

After: ✔️ The Widget with the title "{{Title" exists on the page

Screenshot from 2020-09-10 14-35-41

@engcom-Alfa engcom-Alfa moved this from Testing in Progress to Extended Testing (optional) in Pull Requests Dashboard Sep 10, 2020
@engcom-Alfa engcom-Alfa moved this from Extended Testing (optional) to Merge in Progress in Pull Requests Dashboard Sep 10, 2020
@magento-engcom-team magento-engcom-team merged commit a20a955 into magento:2.4-develop Sep 10, 2020
@m2-assistant
Copy link

m2-assistant bot commented Sep 10, 2020

Hi @engcom-Kilo, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

@ghost ghost moved this from Merge in Progress to Recently Merged in Pull Requests Dashboard Sep 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auto-Tests: Covered All changes in Pull Request is covered by auto-tests Component: CatalogWidget Component: Cms Component: Widget Priority: P1 Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing. Progress: accept QA: Added to Regression Scope Scenario was analysed and added to Regression Testing Scope Release Line: 2.4 Severity: S2 Major restrictions or short-term circumventions are required until a fix is available.
Projects
Pull Requests Dashboard
  
Recently Merged
Development

Successfully merging this pull request may close these issues.

Unable to insert widget with text value which contains }} string
6 participants