-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Update frontend_label and apply_to in CategoryAttribute Fixture. #39936
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
base: 2.4-develop
Are you sure you want to change the base?
Update frontend_label and apply_to in CategoryAttribute Fixture. #39936
Conversation
Hi @JamelleG. Thank you for your contribution!
Allowed build names are:
You can find more information about the builds here For more details, review the Code Contributions documentation. |
@magento create issue |
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.
Pull Request Overview
This PR updates the CategoryAttribute fixture to use the correct frontend_label
key and set a sensible default for apply_to
, preventing array-to-string conversion errors when no value is supplied.
- Rename
default_frontend_label
tofrontend_label
so the fixture uses the correct attribute field - Change default
apply_to
from an empty array to"category"
to match expected input
Comments suppressed due to low confidence (1)
app/code/Magento/Catalog/Test/Fixture/CategoryAttribute.php:47
- The
apply_to
property originally expected an array of strings. Passing a single string may break consumers that iterate over this value. Consider using['category']
instead of a bare string.
'apply_to' => 'category',
Description (*)
This PR aims to address issues discovered when trying to use the following fixture.
app/code/Magento/Catalog/Test/Fixture/CategoryAttribute.php
default_frontend_label
when the value that it actually saves/loads from isfrontend_label
.Changes
apply_to
to have a default ofcategory
which I took fromdev/tests/api-functional/testsuite/Magento/GraphQl/CatalogGraphQl/AttributesMetadataTest.php
default_frontend_label
tofrontend_label
Manual testing scenarios (*)
app/code/Magento/Catalog/Test/Fixture/CategoryAttribute.php
apply_to
and no errors should occur.Questions or comments
Contribution checklist (*)
Resolved issues: