Bugzilla – Attachment 142602 Details for
Bug 31196
Key "default_value_for_mod_marc-" cleared from cache but not set anymore
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 31196: Remove 'default_value_for_mod_marc-' clear_from_cache calls
Bug-31196-Remove-defaultvalueformodmarc--clearfrom.patch (text/plain), 11.69 KB, created by
Jonathan Druart
on 2022-10-25 09:18:21 UTC
(
hide
)
Description:
Bug 31196: Remove 'default_value_for_mod_marc-' clear_from_cache calls
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2022-10-25 09:18:21 UTC
Size:
11.69 KB
patch
obsolete
>From 1aa5c30e8d86a80df3091f008804f285ae218540 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 20 Jul 2022 09:38:57 +0200 >Subject: [PATCH] Bug 31196: Remove 'default_value_for_mod_marc-' > clear_from_cache calls > >We are seeing the following lines several times in the codebase > $cache->clear_from_cache("default_value_for_mod_marc-"); > >But values are never set for this key. > >Test plan: >Ask you, "Is the above correct?" >Use the correct 'git grep' and 'git log' and confirm the assertion. >--- > admin/biblio_framework.pl | 2 -- > admin/koha2marclinks.pl | 4 +--- > admin/marc_subfields_structure.pl | 2 -- > admin/marctagstructure.pl | 2 -- > installer/data/mysql/updatedatabase.pl | 1 - > t/db_dependent/Items.t | 2 -- > t/db_dependent/Items/AutomaticItemModificationByAge.t | 2 -- > t/db_dependent/Koha/Biblio.t | 2 -- > t/db_dependent/Koha/Item.t | 2 -- > t/db_dependent/Koha/Item/Attributes.t | 1 - > t/db_dependent/Koha/UI/Form/Builder/Item.t | 2 -- > t/db_dependent/Reserves.t | 2 -- > 12 files changed, 1 insertion(+), 23 deletions(-) > >diff --git a/admin/biblio_framework.pl b/admin/biblio_framework.pl >index 4712f0ea728..d8988e0ecd1 100755 >--- a/admin/biblio_framework.pl >+++ b/admin/biblio_framework.pl >@@ -78,7 +78,6 @@ if ( $op eq 'add_form' ) { > } > $cache->clear_from_cache("MarcStructure-0-$frameworkcode"); > $cache->clear_from_cache("MarcStructure-1-$frameworkcode"); >- $cache->clear_from_cache("default_value_for_mod_marc-"); > $cache->clear_from_cache("MarcSubfieldStructure-$frameworkcode"); > $cache->clear_from_cache("MarcCodedFields-$frameworkcode"); > $op = 'list'; >@@ -110,7 +109,6 @@ if ( $op eq 'add_form' ) { > } > $cache->clear_from_cache("MarcStructure-0-$frameworkcode"); > $cache->clear_from_cache("MarcStructure-1-$frameworkcode"); >- $cache->clear_from_cache("default_value_for_mod_marc-"); > $cache->clear_from_cache("MarcSubfieldStructure-$frameworkcode"); > $cache->clear_from_cache("MarcCodedFields-$frameworkcode"); > $op = 'list'; >diff --git a/admin/koha2marclinks.pl b/admin/koha2marclinks.pl >index b60e4fdf4f8..769422bcf33 100755 >--- a/admin/koha2marclinks.pl >+++ b/admin/koha2marclinks.pl >@@ -66,9 +66,7 @@ if( $input->param('add_field') && $input->request_method eq 'POST' ) { > > # Clear the cache when needed > unless( $no_upd ) { >- for( qw| default_value_for_mod_marc- MarcSubfieldStructure- | ) { >- $cache->clear_from_cache($_); >- } >+ $cache->clear_from_cache("MarcSubfieldStructure-"); > } > > # Build/Show the form >diff --git a/admin/marc_subfields_structure.pl b/admin/marc_subfields_structure.pl >index 79232aecebd..2d10c41e575 100755 >--- a/admin/marc_subfields_structure.pl >+++ b/admin/marc_subfields_structure.pl >@@ -297,7 +297,6 @@ elsif ( $op eq 'add_validate' ) { > } > $cache->clear_from_cache("MarcStructure-0-$frameworkcode"); > $cache->clear_from_cache("MarcStructure-1-$frameworkcode"); >- $cache->clear_from_cache("default_value_for_mod_marc-"); > $cache->clear_from_cache("MarcSubfieldStructure-$frameworkcode"); > $cache->clear_from_cache("MarcCodedFields-$frameworkcode"); > >@@ -336,7 +335,6 @@ elsif ( $op eq 'delete_confirmed' ) { > > $cache->clear_from_cache("MarcStructure-0-$frameworkcode"); > $cache->clear_from_cache("MarcStructure-1-$frameworkcode"); >- $cache->clear_from_cache("default_value_for_mod_marc-"); > $cache->clear_from_cache("MarcSubfieldStructure-$frameworkcode"); > $cache->clear_from_cache("MarcCodedFields-$frameworkcode"); > print $input->redirect("/cgi-bin/koha/admin/marc_subfields_structure.pl?tagfield=$tagfield&frameworkcode=$frameworkcode"); >diff --git a/admin/marctagstructure.pl b/admin/marctagstructure.pl >index 3514baca938..fbb955db410 100755 >--- a/admin/marctagstructure.pl >+++ b/admin/marctagstructure.pl >@@ -153,7 +153,6 @@ if ($op eq 'add_form') { > } > $cache->clear_from_cache("MarcStructure-0-$frameworkcode"); > $cache->clear_from_cache("MarcStructure-1-$frameworkcode"); >- $cache->clear_from_cache("default_value_for_mod_marc-"); > $cache->clear_from_cache("MarcSubfieldStructure-$frameworkcode"); > $cache->clear_from_cache("MarcCodedFields-$frameworkcode"); > print $input->redirect("/cgi-bin/koha/admin/marctagstructure.pl?searchfield=$tagfield&frameworkcode=$frameworkcode"); >@@ -179,7 +178,6 @@ if ($op eq 'add_form') { > $sth2->execute($searchfield, $frameworkcode); > $cache->clear_from_cache("MarcStructure-0-$frameworkcode"); > $cache->clear_from_cache("MarcStructure-1-$frameworkcode"); >- $cache->clear_from_cache("default_value_for_mod_marc-"); > $cache->clear_from_cache("MarcSubfieldStructure-$frameworkcode"); > $cache->clear_from_cache("MarcCodedFields-$frameworkcode"); > $template->param( searchfield => $searchfield ); >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index 7d204787c9f..c95fdf3e3cc 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -15156,7 +15156,6 @@ if( CheckVersion( $DBversion ) ) { > for my $frameworkcode (@frameworkcodes) { > Koha::Caches->get_instance->clear_from_cache("MarcSubfieldStructure-$frameworkcode"); > } >- Koha::Caches->get_instance->clear_from_cache("default_value_for_mod_marc-"); > } > > SetVersion( $DBversion ); >diff --git a/t/db_dependent/Items.t b/t/db_dependent/Items.t >index be071e729b0..3f8bb8fd62d 100755 >--- a/t/db_dependent/Items.t >+++ b/t/db_dependent/Items.t >@@ -364,7 +364,6 @@ subtest 'SearchItems test' => sub { > my $cache = Koha::Caches->get_instance(); > $cache->clear_from_cache("MarcStructure-0-$frameworkcode"); > $cache->clear_from_cache("MarcStructure-1-$frameworkcode"); >- $cache->clear_from_cache("default_value_for_mod_marc-"); > $cache->clear_from_cache("MarcSubfieldStructure-$frameworkcode"); > > my $item3_record = MARC::Record->new; >@@ -395,7 +394,6 @@ subtest 'SearchItems test' => sub { > # Clear cache > $cache->clear_from_cache("MarcStructure-0-$frameworkcode"); > $cache->clear_from_cache("MarcStructure-1-$frameworkcode"); >- $cache->clear_from_cache("default_value_for_mod_marc-"); > $cache->clear_from_cache("MarcSubfieldStructure-$frameworkcode"); > > ModItemFromMarc($item3_record, $biblio->biblionumber, $item3_itemnumber); >diff --git a/t/db_dependent/Items/AutomaticItemModificationByAge.t b/t/db_dependent/Items/AutomaticItemModificationByAge.t >index 61e6100362e..60507a478ad 100755 >--- a/t/db_dependent/Items/AutomaticItemModificationByAge.t >+++ b/t/db_dependent/Items/AutomaticItemModificationByAge.t >@@ -42,7 +42,6 @@ $dbh->do(qq| > my $cache = Koha::Caches->get_instance(); > $cache->clear_from_cache("MarcStructure-0-$frameworkcode"); > $cache->clear_from_cache("MarcStructure-1-$frameworkcode"); >-$cache->clear_from_cache("default_value_for_mod_marc-"); > $cache->clear_from_cache("MarcSubfieldStructure-$frameworkcode"); > > my $record = MARC::Record->new(); >@@ -341,6 +340,5 @@ is( $schema->resultset('ActionLog')->count(), $actions_nb, q|ToggleNewStatus: no > $cache = Koha::Caches->get_instance(); > $cache->clear_from_cache("MarcStructure-0-$frameworkcode"); > $cache->clear_from_cache("MarcStructure-1-$frameworkcode"); >-$cache->clear_from_cache("default_value_for_mod_marc-"); > $cache->clear_from_cache("MarcSubfieldStructure-$frameworkcode"); > $schema->storage->txn_rollback; >diff --git a/t/db_dependent/Koha/Biblio.t b/t/db_dependent/Koha/Biblio.t >index 94deac1c28e..98eac9b64f7 100755 >--- a/t/db_dependent/Koha/Biblio.t >+++ b/t/db_dependent/Koha/Biblio.t >@@ -715,7 +715,6 @@ subtest 'get_marc_notes() MARC21 tests' => sub { > my $cache = Koha::Caches->get_instance; > $cache->clear_from_cache("MarcStructure-0-"); > $cache->clear_from_cache("MarcStructure-1-"); >- $cache->clear_from_cache("default_value_for_mod_marc-"); > $cache->clear_from_cache("MarcSubfieldStructure-"); > > C4::Biblio::ModBiblio( $record, $biblio->biblionumber ); >@@ -740,7 +739,6 @@ subtest 'get_marc_notes() MARC21 tests' => sub { > > $cache->clear_from_cache("MarcStructure-0-"); > $cache->clear_from_cache("MarcStructure-1-"); >- $cache->clear_from_cache("default_value_for_mod_marc-"); > $cache->clear_from_cache("MarcSubfieldStructure-"); > > $schema->storage->txn_rollback; >diff --git a/t/db_dependent/Koha/Item.t b/t/db_dependent/Koha/Item.t >index aff28a5dd54..0f9326e2722 100755 >--- a/t/db_dependent/Koha/Item.t >+++ b/t/db_dependent/Koha/Item.t >@@ -1291,7 +1291,6 @@ subtest 'columns_to_str' => sub { > my $cache = Koha::Caches->get_instance(); > $cache->clear_from_cache("MarcStructure-0-"); > $cache->clear_from_cache("MarcStructure-1-"); >- $cache->clear_from_cache("default_value_for_mod_marc-"); > $cache->clear_from_cache("MarcSubfieldStructure-"); > > # Creating subfields 'é', 'è' that are not linked with a kohafield >@@ -1370,7 +1369,6 @@ subtest 'columns_to_str' => sub { > > $cache->clear_from_cache("MarcStructure-0-"); > $cache->clear_from_cache("MarcStructure-1-"); >- $cache->clear_from_cache("default_value_for_mod_marc-"); > $cache->clear_from_cache("MarcSubfieldStructure-"); > > $schema->storage->txn_rollback; >diff --git a/t/db_dependent/Koha/Item/Attributes.t b/t/db_dependent/Koha/Item/Attributes.t >index 8a46b318fee..3f7d8abf2dd 100755 >--- a/t/db_dependent/Koha/Item/Attributes.t >+++ b/t/db_dependent/Koha/Item/Attributes.t >@@ -38,7 +38,6 @@ my $item = $builder->build_sample_item({ biblionumber => $biblio->biblionumber } > my $cache = Koha::Caches->get_instance; > $cache->clear_from_cache("MarcStructure-0-"); > $cache->clear_from_cache("MarcStructure-1-"); >-$cache->clear_from_cache("default_value_for_mod_marc-"); > $cache->clear_from_cache("MarcSubfieldStructure-"); > > # 952 $x $é $y are not linked with a kohafield >diff --git a/t/db_dependent/Koha/UI/Form/Builder/Item.t b/t/db_dependent/Koha/UI/Form/Builder/Item.t >index 3be0647dc0d..caa538b7cc6 100755 >--- a/t/db_dependent/Koha/UI/Form/Builder/Item.t >+++ b/t/db_dependent/Koha/UI/Form/Builder/Item.t >@@ -36,7 +36,6 @@ my $builder = t::lib::TestBuilder->new; > my $cache = Koha::Caches->get_instance(); > $cache->clear_from_cache("MarcStructure-0-"); > $cache->clear_from_cache("MarcStructure-1-"); >-$cache->clear_from_cache("default_value_for_mod_marc-"); > $cache->clear_from_cache("MarcSubfieldStructure-"); > > # 952 $x $é are not linked with a kohafield >@@ -350,7 +349,6 @@ subtest 'Fix subfill_with_default_values - no biblionumber passed' => sub { > > $cache->clear_from_cache("MarcStructure-0-"); > $cache->clear_from_cache("MarcStructure-1-"); >-$cache->clear_from_cache("default_value_for_mod_marc-"); > $cache->clear_from_cache("MarcSubfieldStructure-"); > > sub setup_mss { >diff --git a/t/db_dependent/Reserves.t b/t/db_dependent/Reserves.t >index 6fb2c480194..9c8c85d4733 100755 >--- a/t/db_dependent/Reserves.t >+++ b/t/db_dependent/Reserves.t >@@ -67,7 +67,6 @@ $dbh->do("update marc_subfield_structure set kohafield='biblioitems.agerestricti > my $cache = Koha::Caches->get_instance; > $cache->clear_from_cache("MarcStructure-0-$frameworkcode"); > $cache->clear_from_cache("MarcStructure-1-$frameworkcode"); >-$cache->clear_from_cache("default_value_for_mod_marc-"); > $cache->clear_from_cache("MarcSubfieldStructure-$frameworkcode"); > > ## Setup Test >@@ -786,7 +785,6 @@ $dbh->do('DELETE FROM reserves', undef, ($bibnum)); > > $cache->clear_from_cache("MarcStructure-0-$frameworkcode"); > $cache->clear_from_cache("MarcStructure-1-$frameworkcode"); >-$cache->clear_from_cache("default_value_for_mod_marc-"); > $cache->clear_from_cache("MarcSubfieldStructure-$frameworkcode"); > > subtest '_koha_notify_reserve() tests' => sub { >-- >2.25.1
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 31196
:
137895
|
142602
|
142611