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

Laravel error occurring when deleting a product type #2076

Open
lokutus24 opened this issue Jan 23, 2025 · 0 comments
Open

Laravel error occurring when deleting a product type #2076

lokutus24 opened this issue Jan 23, 2025 · 0 comments
Labels
bug Something isn't working unconfirmed

Comments

@lokutus24
Copy link

  • Lunar version: v1.0.0-beta.4
  • Laravel Version: v11.37.0
  • PHP Version: v8.2.25
  • Database Driver & Version:8.0.40

Expected Behaviour:

Delete product type if there are no active or draft products associated with it.

Actual Behaviour:

I don’t have any products in the product type in the admin, yet it doesn’t allow me to delete the product type. It appears in the database with the given product type in a deleted state.

Steps To Reproduce:

  • I created a new Product Type (Standard)
  • i maked a new Product with this Product Type

I deleted this new Product.

If i try to delete this new Product Tpye (Standard) i get laravel inter Server Error Message, Because in database store this deleted Product with exist Product Type foreign Key.

SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (lunar.lunar_products, CONSTRAINT lunar_products_product_type_id_foreign FOREIGN KEY (product_type_id) REFERENCES lunar_product_types (id)) (Connection: mysql, SQL: delete from lunar_product_types where id = 4)

5 NULL 5 draft {"name": {"value": {"en": "", "hu": "Teszt123"}, "... 2025-01-23 13:46:26 2025-01-23 13:49:34 2025-01-23 13:49:34

@lokutus24 lokutus24 added bug Something isn't working unconfirmed labels Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working unconfirmed
Projects
None yet
Development

No branches or pull requests

1 participant