-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Issue #35676 Model/Import/Entity/AbstractEntity restricts import column names to a-z (lowercase) #35859
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
Hi @artskirk. Thank you for your contribution
❗ Automated tests can be triggered manually with an appropriate comment:
You can find more information about the builds here ℹ️ Run only required test builds during development. Run all test builds before sending your pull request for review. For more details, review the Magento Contributor Guide documentation. 🕙 You can find the schedule on the Magento Community Calendar page. 📞 The triage of Pull Requests happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket. ✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel |
@magento run all tests |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time. |
@magento run Functional Tests B2B |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time. |
@magento give me 2.4-develop instance |
Hi @Den4ik. Thank you for your request. I'm working on Magento instance for you. |
Hi @Den4ik, here is your Magento Instance: https://ab5748df481e6e111f5cf57f20ba6b6d.instances.magento-community.engineering |
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.
Hey @artskirk
I have checked your changes and unfortunately could not agree with it by next reasons:
\w
mean any word character and is equal to[a-zA-Z0-9_]
- In fact you should create attribute with
static
type that will add column into entity table - I'm not sure that uppercase characters is as good idea for using in the attribute codes
- Attribute code should start from
[a-z]
. Your expression allow start from digit or_
- If you try to add attribute from admin panel with code start with
_
it will be trimmed. - If you try to add attribute from admin panel with code start digit
attr_
prefix will be added automatically
So I don't see any problems with current logic.
@sidolov Please correct me if I'm wrong
@Den4ik: from my testing, I was able to create an attribute with code I agree with most of your other remarks though. The suggested regex changes aren't correct indeed. This is the validation message you get in the backoffice when trying to create an invalid attribute code:
So I think the regex should be changed to |
Description (*)
Model/Import/Entity/AbstractEntity restricts import column names to a-z (lowercase), 0-9 or underscore and must start with a-z (lowercase). In that case if you are trying to import file with new column name like
Sku_1
it fails with error.app/code/Magento/Catalog/etc/db_schema.xml
and add a new column with name Sku_1admin->System->Data Transfer->Import
What I did
I have updated column validation regular expression to be more flexible.
Related Pull Requests
Fixed Issues (if relevant)
Manual testing scenarios (*)
app/code/Magento/Catalog/etc/db_schema.xml
and add a new column with name Sku_1admin->System->Data Transfer->Import
Questions or comments
Contribution checklist (*)