Closed Serializator closed 4 years ago
Hi @Serializator. Thank you for your report. To help us process this issue please make sure that you provided the following information:
Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:
@magento give me 2.4-develop instance
- upcoming 2.4.x release
For more details, please, review the Magento Contributor Assistant documentation.
Please, add a comment to assign the issue: @magento I am working on this
@Serializator if you have access to page builder repository, please move issue there. Otherwise, I'll ask someone from the Magento community engineering to move it there
@lbajsarowicz, I don't have access to that repository
@tkacheva Could you move the issue to PageBuilder repository, please?
Hi @engcom-Alfa. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:
[ ] 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).Details
If the issue has a valid description, the label Issue: Format is valid
will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid
appears.
[ ] 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description
label to the issue by yourself.
[ ] 3. Add Component: XXXXX
label(s) to the ticket, indicating the components it may be related to.
[ ] 4. Verify that the issue is reproducible on 2.4-develop
branchDetails
- Add the comment @magento give me 2.4-develop instance
to deploy test instance on Magento infrastructure.
- If the issue is reproducible on 2.4-develop
branch, please, add the label Reproduced on 2.4.x
.
- If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!
[ ] 5. Add label Issue: Confirmed
once verification is complete.
[ ] 6. Make sure that automatic system confirms that report has been added to the backlog.
@sdzhepa Could you move this issue to the PageBuilder repo? Thanks!
The bot is trolling... 😑
Attempted to fix this as suggested, but ran into issues where this method is called elsewhere.
I would recommend re-raising this issue in the Magento 2 repository with a view to implementing strict types on the original method.
fyi: @omiroshnichenko @bluemwhitew @nizarn
Due to not possible to transfer issue from private repo to public I have re-created new issue :
I think this one report in PB repo can be closed
Preconditions (*)
Steps to reproduce (*)
Invoke
Magento\Framework\Filter\Template->filter(...)
withnull
as valueExpected result (*)
An empty string, at least not a type error if strict types aren't used for the invoked method
Actual result (*)
Cause
It is caused by the
Magento\PageBuilder\Plugin\Filter\TemplatePlugin
which uses strict types in the after plugin which does not match with any strict types on the original method.It's kinda a double-edged sword. I think this is a bug because a plugin should match the arguments of the method which it is bound to, on the other side it isn't really a bug as much as not checking the data you pass before invocation.
PHPDocs clearly state that the argument should be a string, which is then in-directly enforced by the strict type in the plugin.
What I rather see is that this type is strictly enforced by the method itself directly, but that would be a backwards incompatible change (and the class is annotated with
@api
).null
into an empty stringIf you think this isn't a bug and should be closed because it should be the the responsibility of the developer to check their stuff, I kinda agree actually 😉