Bug 35136

Summary: Error during database update after Bug 31383
Product: Koha Reporter: Owen Leonard <oleonard>
Component: Architecture, internals, and plumbingAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: major    
Priority: P5 - low CC: dcook, fridolin.somers, jonathan.druart, kyle, m.de.rooy, martin.renvoize, nick, oleonard, tomascohen, victor
Version: MainKeywords: rel_23_11_candidate
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
23.11.00
Circulation function:
Bug Depends on: 31383    
Bug Blocks:    
Attachments: Bug 35136: (bug 31383 follow-up) Fix db rev
Bug 35136: (bug 31383 follow-up) Fix db rev
Bug 35136: (bug 31383 follow-up) Fix db rev

Description Owen Leonard 2023-10-23 17:12:22 UTC
I've run across a case where the database upgrade in Bug 31383 triggers an error. The error is:

 ERROR - {UNKNOWN}: Not a HASH reference at /kohadevbox/koha/installer/data/mysql/db_revs/230600041.pl line 130. at /kohadevbox/koha/C4/Installer.pm line 741

I noticed that the error didn't happen if I deleted the 'ISSUESLIP' notice before running the upgrade, and that the error only happened with my custom testing database, not the default Koha testing data.

Comparing the contents of ISSUESLIP in my data and in the default, I see this difference:

In my data:

<p style="margin-bottom: 1px; margin-top: 1px"><<additional_contents.new>></p>

In the default data:

<p style="margin-bottom: 1px; margin-top: 1px"><<additional_contents.content>></p>

I'm not sure where the difference comes in, or how common this case might be in the wild.
Comment 1 Jonathan Druart 2023-10-24 06:07:52 UTC
Created attachment 157724 [details] [review]
Bug 35136: (bug 31383 follow-up) Fix db rev
Comment 2 Jonathan Druart 2023-10-24 06:08:03 UTC
There is an obvious mistake, could you try with this patch please?
Comment 3 Tomás Cohen Arazi (tcohen) 2023-10-24 12:22:15 UTC
Created attachment 157740 [details] [review]
Bug 35136: (bug 31383 follow-up) Fix db rev

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 4 Victor Grousset/tuxayo 2023-10-24 15:50:31 UTC
Created attachment 157750 [details] [review]
Bug 35136: (bug 31383 follow-up) Fix db rev

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Comment 5 Victor Grousset/tuxayo 2023-10-24 15:52:16 UTC
Works, makes sense, QA script happy, code looks good, passing QA :)

Reproduced the error and confirmed that with the fix, updatedatabase works and notifies that ISSUESLIP needs to be manually fixed.
Comment 6 Tomás Cohen Arazi (tcohen) 2023-10-24 18:45:23 UTC
Pushed to master for 23.11.

Nice work everyone, thanks!
Comment 7 Fridolin Somers 2023-10-26 06:58:11 UTC
Depends on Bug 31383 not in 23.05.x