Skip to content
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

Table structure issue catalog_product_entity (sku field is allowed nulls) #27411

Closed
stephan-cream opened this issue Mar 24, 2020 · 15 comments · Fixed by #32532
Closed

Table structure issue catalog_product_entity (sku field is allowed nulls) #27411

stephan-cream opened this issue Mar 24, 2020 · 15 comments · Fixed by #32532
Assignees
Labels
Component: Data Fixed in 2.4.x The issue has been fixed in 2.4-develop branch Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Progress: done Reported on 2.1.x Indicates original Magento version for the Issue report. Severity: S3 Affects non-critical data or functionality and does not force users to employ a workaround.

Comments

@stephan-cream
Copy link
Contributor

stephan-cream commented Mar 24, 2020

Preconditions (*)

  1. Any Magento version (tested on all significant releases, 2.1, 2.2, 2.3)
  2. Reproduced on 2.4-develop

Steps to reproduce (*)

  1. Add a product either through migration, a custom importer or directly in the database.
  2. Leave out the field SKU (in other words, leave it NULL).
  3. Go to the product edit page in the backoffice.

Expected result (*)

  1. Should not be possible to add the product OR should not throw an error in the backoffice.

Actual result (*)

  1. Product is added without issues.
  2. When attempting to edit the product in the backoffice the following error is thrown:
    Fatal error: Uncaught TypeError: Argument 1 passed to Magento\Catalog\Model\ProductRepository::prepareSku() must be of the type string, null given, called in /vendor/magento/module-catalog/Model/ProductRepository.php on line 790 and defined in /vendor/magento/module-catalog/Model/ProductRepository.php:800 Stack trace: #0 /vendor/magento/module-catalog/Model/ProductRepository.php(790): Magento\Catalog\Model\ProductRepository->prepareSku(NULL) #1 /vendor/magento/module-catalog/Model/ProductRepository.php(349): Magento\Catalog\Model\ProductRepository->saveProductInLocalCache(Object(Magento\Catalog\Model\Product\Interceptor), '3e07f167255019f...') #2 /vendor/magento/module-catalog/Model/ProductRepository.php(314): Magento\Catalog\Model\ProductRepository->cacheProduct('3e07f167255019f...', Object(Magento\Catalog\Model\Product in /vendor/magento/module-catalog/Model/ProductRepository.php on line 800
@m2-assistant
Copy link

m2-assistant bot commented Mar 24, 2020

Hi @stephan-cream. Thank you for your report.
To help us process this issue please make sure that you provided the following information:

  • Summary of the issue
  • Information on your environment
  • Steps to reproduce
  • Expected and actual results

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.

@stephan-cream do you confirm that you were able to reproduce the issue on vanilla Magento instance following steps to reproduce?

  • yes
  • no

@magento-engcom-team magento-engcom-team added the Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed label Mar 24, 2020
@stephan-cream
Copy link
Contributor Author

I believe this to be a mistake in the structure design, as SKU is required throughout Magento.

@rodrigowebjump
Copy link
Member

@magento give me 2.4-develop instance

@magento-engcom-team
Copy link
Contributor

Hi @rodrigowebjump. Thank you for your request. I'm working on Magento 2.4-develop instance for you

@magento-engcom-team
Copy link
Contributor

Hi @rodrigowebjump, here is your Magento instance.
Admin access: https://i-27411-2-4-develop.instances.magento-community.engineering/admin_399e
Login: 7deac959 Password: acb0d5600985
Instance will be terminated in up to 3 hours.

@magento-engcom-team magento-engcom-team added this to Ready for QA in Community Backlog Mar 24, 2020
@stephan-cream
Copy link
Contributor Author

This is a database issue, unless you can directly insert the product in the database (or use custom code to import it) without an SKU this is not 'testable' on an Magento github generated development instance.

@sidolov sidolov added this to Ready for Grooming in Low Priority Backlog Sep 24, 2020
@sidolov sidolov added this to Ready for Confirmation in Issue Confirmation and Triage Board Oct 21, 2020
@ghost ghost removed this from Ready for QA in Community Backlog Oct 21, 2020
@ghost ghost removed this from Ready for Grooming in Low Priority Backlog Oct 21, 2020
@ghost ghost added Issue: ready for confirmation and removed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed labels Oct 21, 2020
@magento-engcom-team magento-engcom-team added the Reported on 2.1.x Indicates original Magento version for the Issue report. label Nov 13, 2020
@Pavel-Fekete
Copy link

Reproducible on the latest 2.4-develop
Product is added without issues, even if SKU value is 'NULL'

database

@engcom-Bravo engcom-Bravo self-assigned this Dec 16, 2020
@m2-assistant
Copy link

m2-assistant bot commented Dec 16, 2020

Hi @engcom-Bravo. 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).

    DetailsIf 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 branch

    Details- 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.

@engcom-Bravo engcom-Bravo added Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Component: Data Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Priority: P3 May be fixed according to the position in the backlog. labels Dec 16, 2020
@m2-community-project m2-community-project bot added this to Dev In Progress in Low Priority Backlog Dec 16, 2020
@engcom-Bravo engcom-Bravo added the Severity: S3 Affects non-critical data or functionality and does not force users to employ a workaround. label Dec 16, 2020
@m2-community-project m2-community-project bot removed this from Ready for Confirmation in Issue Confirmation and Triage Board Dec 16, 2020
@engcom-Bravo engcom-Bravo added the Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed label Dec 16, 2020
@magento-engcom-team
Copy link
Contributor

✅ Confirmed by @engcom-Bravo
Thank you for verifying the issue. Based on the provided information internal tickets MC-39963 were created

Issue Available: @engcom-Bravo, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.

@m2-community-project m2-community-project bot removed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: ready for confirmation Progress: done labels Mar 17, 2021
@m2-community-project m2-community-project bot moved this from Done to Ready for Development in Low Priority Backlog Mar 17, 2021
@m2-community-project m2-community-project bot moved this from Ready for Development to Pull Request In Progress in Low Priority Backlog Mar 17, 2021
@sidolov sidolov added Priority: P2 A defect with this priority could have functionality issues which are not to expectations. and removed Priority: P3 May be fixed according to the position in the backlog. labels Mar 18, 2021
@m2-community-project m2-community-project bot added this to Pull Request In Progress in High Priority Backlog Mar 18, 2021
@m2-community-project m2-community-project bot removed this from Pull Request In Progress in Low Priority Backlog Mar 18, 2021
@gabrieldagama gabrieldagama added the Fixed in 2.4.x The issue has been fixed in 2.4-develop branch label Apr 11, 2021
@gabrieldagama
Copy link
Contributor

Hi @stephan-cream. Thank you for your report.
The issue has been fixed in #32532 by @ihor-sviziev in 2.4-develop branch
Related commit(s):

The fix will be available with the upcoming 2.4.3 release.

@m2-community-project m2-community-project bot moved this from Pull Request In Progress to Done in High Priority Backlog Apr 11, 2021
@m2-community-project m2-community-project bot moved this from Done to Pull Request In Progress in High Priority Backlog Apr 11, 2021
@m2-community-project m2-community-project bot moved this from Pull Request In Progress to Ready for Development in High Priority Backlog Aug 24, 2021
@m2-community-project m2-community-project bot moved this from Pull Request In Progress to Ready for Development in High Priority Backlog Aug 24, 2021
@m2-community-project m2-community-project bot moved this from Ready for Development to Done in High Priority Backlog Aug 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Data Fixed in 2.4.x The issue has been fixed in 2.4-develop branch Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Progress: done Reported on 2.1.x Indicates original Magento version for the Issue report. Severity: S3 Affects non-critical data or functionality and does not force users to employ a workaround.
Projects
Development

Successfully merging a pull request may close this issue.

12 participants