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

[Backport] [Widget] Fixing the multidimensional array as value for the widget's parameter #22214

Merged

Conversation

ilnytskyi
Copy link
Contributor

Original Pull Request

#21008

Description (*)

This PR gives the possibility to use a multi row field as a parameter for a widget.

<parameter name="conditions" xsi:type="block" visible="true" sort_order="30">
    <label translate="true">Tabs</label>
    <block class="Atwix\Tabs\Block\Adminhtml\Widget\Form\Element" />
</parameter>

After saving the widget, or opening, you'll have 2 exceptions thrown:
Warning: html_entity_decode() expects parameter 1 to be string, array given in /home/dev/sites/mage23/app/code/Magento/Widget/Block/Adminhtml/Widget/Options.php on line 170

Warning: htmlspecialchars() expects parameter 1 to be string, array given in /home/dev/sites/mage23/lib/internal/Magento/Framework/Data/Form/Element/AbstractElement.php on line 290

As a result, you should are able to save and open the widget:
xnip2019-02-06_09-59-09

Fixed Issues (if relevant)

  1. Not possible to use multidimensional arrays in widget parameters #19909: Not possible to use multidimensional arrays in widget parameters
  2. ...

Manual testing scenarios (*)

  1. ...
  2. ...

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 on Travis CI are green)

@m2-assistant
Copy link

m2-assistant bot commented Apr 8, 2019

Hi @ilnytskyi. 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-engcom-team give me test instance - deploy test instance based on PR changes
  • @magento-engcom-team give me 2.2-develop instance - deploy vanilla Magento instance

For more details, please, review the Magento Contributor Assistant documentation

Copy link
Contributor

@orlangur orlangur left a comment

Choose a reason for hiding this comment

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

phpcs:ignore does not have effect in 2.2-develop AFAIK but let's leave it.

@ghost ghost assigned orlangur Apr 8, 2019
@magento-engcom-team
Copy link
Contributor

Hi @orlangur, thank you for the review.
ENGCOM-4702 has been created to process this Pull Request

@m2-assistant
Copy link

m2-assistant bot commented Apr 23, 2019

Hi @ilnytskyi, 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.

magento-engcom-team pushed a commit that referenced this pull request Apr 23, 2019
@magento-engcom-team magento-engcom-team added this to the Release: 2.2.9 milestone Apr 23, 2019
@klaudiomaraj
Copy link

Hi @ilnytskyi , could you give us an practical example of how in this case the Element.php of this parameter should be? , because im having difficulties creating one like in the image you loaded.

@ghost
Copy link

ghost commented Jan 23, 2020

@klaudiomaraj unfortunately, only members of the maintainers team are allowed to unassign developers from the pull request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants