-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Module catalog, Attribute Repository code validation regex #29015
Module catalog, Attribute Repository code validation regex #29015
Conversation
Regex modified to accept the A-Z range and check for Magento\Eav\Model\Entity\Attribute::ATTRIBUTE_CODE_MAX_LENGTH instead of the old hardcoded value (30)
Hi @drc0. Thank you for your contribution
❗ Automated tests can be triggered manually with an appropriate comment:
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. |
@magento run all tests |
@magento run all tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @drc0, thanks for the pull request, it looks good!
Please follow below some comments on it, can you fix the static tests failures?
We also need to cover the changes with some tests, we could create some integration tests to validate the changes proposed on this PR, let me know if you are able to create these tests!
Thank you!
app/code/Magento/Catalog/Model/Product/Attribute/Repository.php
Outdated
Show resolved
Hide resolved
app/code/Magento/Catalog/Model/Product/Attribute/Repository.php
Outdated
Show resolved
Hide resolved
For now I'm unable to create a test for the proposed changes. should app/code/Magento/Catalog/Test/Unit/Model/Product/Attribute/RepositoryTest.php be modified to check for this validation on the length of the attribute code adding a new class method for the test case? |
Hi @drc0, yeah I guess we can update that unit test to validate the proposed changes. Thanks! |
Hi @drc0 can you please look at #29015 (comment) ? |
Hi @drc0, I'll take care of test coverage. |
awesome, thank you. |
Hi @drc0, can you please take a look at #29017 (comment)? |
I close PR because the issue isn't produced anymore. |
Hi @drc0, thank you for your contribution! |
Hi @gabrieldagama, thank you for the review.
|
Note: Functional Tests B2B are failed |
Hi @drc0, thank you for your contribution! |
Regex modified to accept the A-Z range and check for Magento\Eav\Model\Entity\Attribute::ATTRIBUTE_CODE_MAX_LENGTH instead of the old hardcoded value (30)
Description (*)
In the magento module catalog, in the method validateCode for product attribute attribute_code field, there were a check for the attribute length that do not respect the Magento\Eav\Model\Entity\Attribute::ATTRIBUTE_CODE_MAX_LENGTH constant, also I think it should accept chars of the A-Z range.
fixes #29017