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) #32525

Closed
dverkade opened this issue Mar 17, 2021 · 3 comments · Fixed by #32532
Closed

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

dverkade opened this issue Mar 17, 2021 · 3 comments · Fixed by #32532
Assignees
Labels
duplicate Fixed in 2.4.x The issue has been fixed in 2.4-develop branch Issue: ready for confirmation Priority: P3 May be fixed according to the position in the backlog. Progress: done Severity: S3 Affects non-critical data or functionality and does not force users to employ a workaround.

Comments

@dverkade
Copy link
Member

Preconditions

  1. Any Magento version (tested on all significant releases, 2.1, 2.2, 2.3)
  2. Reproduced on 2.4-develop
  3. #magento2/27411 was closed while it's a verified and open bug. You can't do that. Opening this as a new issue.

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 17, 2021

Hi @dverkade. 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.

Please, add a comment to assign the issue: @magento I am working on this


⚠️ According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.

🕙 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, please join the Community Contributions Triage session to discuss the appropriate ticket.

🎥 You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel

✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel

@m2-community-project m2-community-project bot added this to Ready for Confirmation in Issue Confirmation and Triage Board Mar 17, 2021
@m2-community-project m2-community-project bot added Priority: P3 May be fixed according to the position in the backlog. Severity: S3 Affects non-critical data or functionality and does not force users to employ a workaround. labels Mar 17, 2021
@ihor-sviziev
Copy link
Contributor

@dverkade, thx for raising this issue again. I'll re-open the original issue, as it was already prioritized.
I'll close this one as duplicate.

BTW I created a PR that suppose to fix this issue #32532

@gabrieldagama
Copy link
Contributor

Hi @dverkade. 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.

@gabrieldagama gabrieldagama added the Fixed in 2.4.x The issue has been fixed in 2.4-develop branch label Apr 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate Fixed in 2.4.x The issue has been fixed in 2.4-develop branch Issue: ready for confirmation Priority: P3 May be fixed according to the position in the backlog. Progress: done 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.

3 participants