Bugzilla – Attachment 163094 Details for
Bug 36232
Error fixing OAI-PMH:AutoUpdateSetsEmbedItemData syspref name on the DB
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36232: Fix error in DBRev dealing with OAI-PMH:AutoUpdateSetsEmbedItemData typo
Bug-36232-Fix-error-in-DBRev-dealing-with-OAI-PMHA.patch (text/plain), 3.20 KB, created by
Biblibre Sandboxes
on 2024-03-12 16:17:11 UTC
(
hide
)
Description:
Bug 36232: Fix error in DBRev dealing with OAI-PMH:AutoUpdateSetsEmbedItemData typo
Filename:
MIME Type:
Creator:
Biblibre Sandboxes
Created:
2024-03-12 16:17:11 UTC
Size:
3.20 KB
patch
obsolete
>From c7a2ae294341a4fb071ea49b429006e261d088a4 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Mon, 11 Mar 2024 09:44:35 -0300 >Subject: [PATCH] Bug 36232: Fix error in DBRev dealing with > OAI-PMH:AutoUpdateSetsEmbedItemData typo > >This patch fixes the case of the wrong syspref variable co-existing with >the good one. > >OAI-PMH:AutoUpdateSetsEmbedItemData is the only case, as the rest of the >mispelled ones are just case fixes, which would not trigger the same >situation as the `systempreferences` table collation is >case-insentitive. > >To test: >1. Run: > $ ktd --shell > k$ koha-mysql kohadev > > INSERT INTO systempreferences VALUES ('OAI-PMH:AutoUpdateSetEmbedItemData',0,'','','YesNo'); > > UPDATE systempreferences SET variable = 'IllCheckAvailability' WHERE variable = "ILLCheckAvailability"; > > INSERT INTO systempreferences VALUES ('IllCheckAvailability',0,'','','YesNo'); >=> FAIL: The last command fails because the good and wrong values cannot >coexist >2. Set the version to a prior one: > > UPDATE systempreferences SET value="23.1200004" WHERE variable like 'version'; >3. Run: > k$ updatedatabase >=> FAIL: You get this error: >ERROR: {UNKNOWN}: DBI Exception: DBD::mysql::db do failed: Duplicate entry 'OAI-PMH:AutoUpdateSetsEmbedItemData' for key 'systempreferences.PRIMARY' at ... >4. Apply this patch >5. Repeat 3 >=> SUCCESS: It works! >6. Sign off :-D > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> >Signed-off-by: David Nind <david@davidnind.com> >Signed-off-by: Mohd Hafiz Yusoff <mhby87@gmail.com> >--- > installer/data/mysql/db_revs/231200005.pl | 19 +++++++++++++++---- > 1 file changed, 15 insertions(+), 4 deletions(-) > >diff --git a/installer/data/mysql/db_revs/231200005.pl b/installer/data/mysql/db_revs/231200005.pl >index 58e3981346..c044287e58 100755 >--- a/installer/data/mysql/db_revs/231200005.pl >+++ b/installer/data/mysql/db_revs/231200005.pl >@@ -80,13 +80,24 @@ return { > my @misspelled; > my $pref; > >+ my $good_exists = $dbh->selectrow_array( >+ q{SELECT variable FROM systempreferences WHERE variable = 'OAI-PMH:AutoUpdateSetsEmbedItemData'}); >+ > $pref = $dbh->selectrow_array( > q{SELECT variable FROM systempreferences WHERE variable = 'OAI-PMH:AutoUpdateSetEmbedItemData'}); >+ > if ( $pref eq "OAI-PMH:AutoUpdateSetEmbedItemData" ) { >- $dbh->do( >- q{UPDATE systempreferences SET variable = 'OAI-PMH:AutoUpdateSetsEmbedItemData' WHERE variable = "OAI-PMH:AutoUpdateSetEmbedItemData"} >- ); >- push @misspelled, "AutoUpdateSetsEmbedItemData"; >+ if ($good_exists) { >+ >+ # Already exists, just delete the bad one >+ $dbh->do(q{DELETE FROM systempreferences WHERE variable = "OAI-PMH:AutoUpdateSetEmbedItemData"}); >+ } else { >+ $dbh->do( >+ q{UPDATE systempreferences SET variable = 'OAI-PMH:AutoUpdateSetsEmbedItemData' WHERE variable = "OAI-PMH:AutoUpdateSetEmbedItemData"} >+ ); >+ } >+ >+ push @misspelled, "OAI-PMH:AutoUpdateSetsEmbedItemData"; > } > > # Fix capitalization issues breaking unit tests >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 36232
:
163027
|
163062
|
163063
|
163094
|
163095