Open
Description
Summary (*)
Model/Import/Entity/AbstractEntity restricts import column names to a-z (lowercase), 0-9 or underscore and must start with a-z (lowercase). Why? What is the point/value of this restriction?
Examples (*)
if (!$this->isAttributeParticular($columnName)) {
if (trim($columnName) == '') {
$emptyHeaderColumns[] = $columnNumber;
} elseif (!preg_match('/^[a-z][a-z0-9_]*$/', $columnName)) {
$invalidColumns[] = $columnName;
} elseif ($this->needColumnCheck && !in_array($columnName, $this->getValidColumnNames())) {
$invalidAttributes[] = $columnName;
}
}
Proposed solution
Either:
- Remove it.
- Make this more flexible so we can use a-z, A-Z, 0-9, spaces and whatever symbols we want.
- Add getValidatorPrereg() that allows us to override with our own checks for custom imports.
Please provide Severity assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.
- Severity: S0 - Affects critical data or functionality and leaves users with no workaround.
- Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
- [ x] Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
- Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
- Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.
Activity
m2-assistant commentedon Jun 24, 2022
Hi @adamlavery. Thank you for your report.
To speed up processing of this issue, make sure that you provided the following information:
Make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:
@magento give me 2.4-develop instance
- upcoming 2.4.x releaseFor more details, review the Magento Contributor Assistant documentation.
Add a comment to assign the issue:
@magento I am working on this
To learn more about issue processing workflow, refer to the Code Contributions.
🕙 You can find the schedule on the Magento Community Calendar page.
📞 The triage of issues 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
m2-assistant commentedon Jul 19, 2022
Hi @engcom-Hotel. 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: 👇
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 labelIssue: Format is valid
will be added to the issue automatically. Please, edit issue description if needed, until labelIssue: 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 labelReproduced 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.
engcom-Hotel commentedon Jul 19, 2022
Hello @adamlavery,
Thanks for the report and collaboration!
To more understand the issue we need your use case in which this functionality is not working for you as expected and also please provide the below information as well:
Thanks
adamlavery commentedon Jul 19, 2022
Hi, the issue is described well enough already and doesn't need screenshots or steps. Below example of a custom import that is blocked by the a-z/0-9 column name restriction. Had to override the core class to allow this format to be read so it can be processed.
The sensible approach is to allow the child class to specify a different validation check, defaulting to usual core validation.
engcom-Hotel commentedon Jul 26, 2022
Hello @adamlavery,
We have tried to reproduce the issue in Magento 2.4-develop and the issue seems reproducible for us via following the below steps:
app/code/Magento/Catalog/etc/db_schema.xml
line number 17 and add a new column with nameSku_1
bin/magento setup:upgrade
. This will create a new column with nameSku_1
in tablecatalog_product_entity
.admin->System->Data Transfer->Import
Hence confirming the issue.
Thanks
24 remaining items