Bug 29409

Summary: Update for bug 25333 can fail due to bad data or constraints
Product: Koha Reporter: Nick Clemens <nick>
Component: NoticesAssignee: Nick Clemens <nick>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: arthur.suzuki, lucas, martin.renvoize, victor
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
22.11.00, 22.05.07, 21.11.14
Bug Depends on: 25333    
Bug Blocks:    
Attachments: Bug 29409: Check for existence of constraint before deletion
Bug 29409: Check for data that violates a constraint to avoid update problems
Bug 29409: Check for existence of constraint before deletion
Bug 29409: Check for data that violates a constraint to avoid update problems
Bug 29409: Check for existence of constraint before deletion
Bug 29409: Check for data that violates a constraint to avoid update problems

Description Nick Clemens 2021-11-03 16:48:41 UTC
The update does not check for the existence of the foreign key before deleting it

Additionally we have seen many sites with problematic data that stops the update, will offer a check for what we have seen here
Comment 1 Nick Clemens 2021-11-03 16:54:44 UTC
Created attachment 127275 [details] [review]
Bug 29409: Check for existence of constraint before deletion

https://bugs.koha-community.org/show_bug.cgi?id=29049
Comment 2 Nick Clemens 2021-11-03 16:54:48 UTC
Created attachment 127276 [details] [review]
Bug 29409: Check for data that violates a constraint to avoid update problems

https://bugs.koha-community.org/show_bug.cgi?id=29049
Comment 3 Joonas Kylmälä 2022-08-28 17:51:03 UTC
Created attachment 139931 [details] [review]
Bug 29409: Check for existence of constraint before deletion

https://bugs.koha-community.org/show_bug.cgi?id=29049

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Comment 4 Joonas Kylmälä 2022-08-28 17:51:06 UTC
Created attachment 139932 [details] [review]
Bug 29409: Check for data that violates a constraint to avoid update problems

https://bugs.koha-community.org/show_bug.cgi?id=29049

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Comment 5 Martin Renvoize 2022-09-12 16:51:48 UTC
Created attachment 140481 [details] [review]
Bug 29409: Check for existence of constraint before deletion

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 6 Martin Renvoize 2022-09-12 16:51:53 UTC
Created attachment 140482 [details] [review]
Bug 29409: Check for data that violates a constraint to avoid update problems

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 7 Martin Renvoize 2022-09-12 16:52:17 UTC
Great work, Passing QA
Comment 8 Tomás Cohen Arazi 2022-09-12 19:42:11 UTC
Pushed to master for 22.11.

Nice work everyone, thanks!
Comment 9 Lucas Gass 2022-10-31 21:27:18 UTC
Backported to 22.05.x for upcoming 22.05.07 release
Comment 10 Arthur Suzuki 2022-11-14 14:19:17 UTC
applied to 21.11 for 21.11.14
Comment 11 Victor Grousset/tuxayo 2022-11-20 00:35:51 UTC
Not backported to oldoldstable (21.05.x). Feel free to ask if it's needed.

Nothing to document it seems, marking resolved.