Bug 36232: Fix error in DBRev dealing with OAI-PMH:AutoUpdateSetsEmbedItemData typo
authorTomas Cohen Arazi <tomascohen@theke.io>
Mon, 11 Mar 2024 12:44:35 +0000 (09:44 -0300)
committerFridolin Somers <fridolin.somers@biblibre.com>
Wed, 13 Mar 2024 08:10:31 +0000 (09:10 +0100)
commite196ce38495c10282080e3161b766906ed90083f
tree4455481c0c24abf06958cff771476017e03fe36c
parent9ec9fc3d78143e99313291f1cd31b554aeec20d6
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>
Signed-off-by: Mohd Hafiz Yusoff <mhby87@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit c73c27e02d37712648d6f253aac42c2bb40c1621)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
installer/data/mysql/db_revs/231102002.pl