Skip to content

Add 'const' type support to layout arguments #15058

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

Conversation

IgorVitol
Copy link
Contributor

Description

For now in Magento we can not use xsi:type="const" in layout arguments. But it looks like such ability can be very useful. Moreover such code already exists in Magento core, we just need to include/enable it.

Manual testing scenarios

  1. Add argument with "const" type to any block via layout arguments. For example like this:
<referenceBlock name="product.info.sku">
    <arguments>
        <argument name="my_const_value" xsi:type="const">Magento\Catalog\Api\Data\ProductAttributeInterface::ENTITY_TYPE_CODE</argument>
    </arguments>
</referenceBlock>
  1. Verify that it is correctly passed to block constructor. Like here: http://prntscr.com/jf7qa0

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)

@VladimirZaets
Copy link
Contributor

Hi, @IgorVitol, I took your PR into processing, thank you for collaboration.

@magento-engcom-team
Copy link
Contributor

Hi @IgorVitol. Thank you for your contribution.
Changes from your Pull Request will be available with the upcoming 2.2.5 release.

Please, consider porting this solution across release lines.
You may use Porting tool to port commits automatically.

@IgorVitol
Copy link
Contributor Author

Changes from your Pull Request will be available with the upcoming 2.2.5 release.

Hi! I checked 2.2.5 release for CE/EE version and was not able to find this code changes. Does anyone know why?

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.

3 participants