thelia
thelia copied to clipboard
A language cannot be deleted if it is referenced by an order
When trying to delete an language, the following error is displayed if this language is referenced in the order table.
Propel\Runtime\ActiveQuery\ModelCriteria::delete is unable to delete.
The exception cause is :
SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (
thelia2.
order, CONSTRAINT
fk_order_lang_idFOREIGN KEY (
lang_id) REFERENCES
lang(
id))
We have to remove this constraint (which, BTW, doesn't exists in the customer table).
We already talked about this. I think that the solution is to create an order_lang
table to always keep all the data of every order.
:+1:
Ohhh, I already posted an issue for that Oo #644 Let's close one of the two issues :)
This issue is partially fixed by #1832
Language has now two flag active
and visible
to display it in back and front. So we're not obliged to delete it to hide it in the front.
I dot not agree to close this issue. A Thelia admin should be able to completely delete a language. @lovenunu gave the proper solution to this problem.
Should implement a table order_lang, like #964
Same issue as #1145, the order table should not have any foreign keys on a table that does not belong to the order.