View | Details | Raw Unified | Return to bug 30848
Collapse All | Expand All

(-)a/C4/Biblio.pm (-1 / +1 lines)
Lines 1523-1529 sub GetAuthorisedValueDesc { Link Here
1523
1523
1524
    my $dbh = C4::Context->dbh;
1524
    my $dbh = C4::Context->dbh;
1525
    if ( $category ne "" ) {
1525
    if ( $category ne "" ) {
1526
        $cache_key = "AVDescriptions";
1526
        $cache_key = "AVDescriptions-" . $category;
1527
        my $av_descriptions = $cache->get_from_cache( $cache_key, { unsafe => 1 } );
1527
        my $av_descriptions = $cache->get_from_cache( $cache_key, { unsafe => 1 } );
1528
        if ( !$av_descriptions ) {
1528
        if ( !$av_descriptions ) {
1529
            $av_descriptions = {
1529
            $av_descriptions = {
(-)a/Koha/AuthorisedValue.pm (-1 / +32 lines)
Lines 19-25 package Koha::AuthorisedValue; Link Here
19
19
20
use Modern::Perl;
20
use Modern::Perl;
21
21
22
22
use Koha::Caches;
23
use Koha::Database;
23
use Koha::Database;
24
24
25
use base qw(Koha::Object Koha::Object::Limit::Library);
25
use base qw(Koha::Object Koha::Object::Limit::Library);
Lines 34-39 Koha::AuthorisedValue - Koha Authorised value Object class Link Here
34
34
35
=cut
35
=cut
36
36
37
=head3 store
38
39
AuthorisedValue specific store to ensure relevant caches are flushed on change
40
41
=cut
42
43
sub store {
44
    my ($self) = @_;
45
46
    my $flush = 0;
47
48
    if ( !$self->in_storage ) {
49
        $flush = 1;
50
    }
51
    else {
52
        my $self_from_storage = $self->get_from_storage;
53
        $flush = 1 if ( $self_from_storage->lib ne $self->lib );
54
        $flush = 1 if ( $self_from_storage->lib_opac ne $self->lib_opac );
55
    }
56
57
    $self = $self->SUPER::store;
58
59
    if ($flush) {
60
        my $cache = Koha::Caches->get_instance();
61
        my $key = "AVDescriptions-".$self->category;
62
        $cache->clear_from_cache($key);
63
    }
64
65
    return $self;
66
}
67
37
=head3 opac_description
68
=head3 opac_description
38
69
39
my $description = $av->opac_description();
70
my $description = $av->opac_description();
(-)a/Koha/ClassSource.pm (-6 / +1 lines)
Lines 54-65 sub store { Link Here
54
54
55
    if ($flush) {
55
    if ($flush) {
56
        my $cache = Koha::Caches->get_instance();
56
        my $cache = Koha::Caches->get_instance();
57
        my @frameworks =
57
        $cache->clear_from_cache('ClassSources');
58
          Koha::BiblioFrameworks->search()->get_column('frameworkcode');
59
        for my $frameworkcode (@frameworks) {
60
            my $key = "MarcAVStructure-$frameworkcode";
61
            $cache->clear_from_cache($key);
62
        }
63
    }
58
    }
64
59
65
    return $self;
60
    return $self;
(-)a/Koha/ItemType.pm (-6 / +2 lines)
Lines 61-72 sub store { Link Here
61
61
62
    if ($flush) {
62
    if ($flush) {
63
        my $cache = Koha::Caches->get_instance();
63
        my $cache = Koha::Caches->get_instance();
64
        my @frameworks =
64
        my $key = "enItemTypeDescriptions";
65
          Koha::BiblioFrameworks->search()->get_column('frameworkcode');
65
        $cache->clear_from_cache($key);
66
        for my $frameworkcode (@frameworks) {
67
            my $key = "MarcAVStructure-$frameworkcode";
68
            $cache->clear_from_cache($key);
69
        }
70
    }
66
    }
71
67
72
    return $self;
68
    return $self;
(-)a/Koha/Library.pm (-6 / +1 lines)
Lines 61-72 sub store { Link Here
61
61
62
    if ($flush) {
62
    if ($flush) {
63
        my $cache = Koha::Caches->get_instance();
63
        my $cache = Koha::Caches->get_instance();
64
        my @frameworks =
64
        $cache->clear_from_cache('LibraryNames');
65
          Koha::BiblioFrameworks->search()->get_column('frameworkcode');
66
        for my $frameworkcode (@frameworks) {
67
            my $key = "MarcAVStructure-$frameworkcode";
68
            $cache->clear_from_cache($key);
69
        }
70
    }
65
    }
71
66
72
    return $self;
67
    return $self;
(-)a/Koha/Localization.pm (+29 lines)
Lines 21-26 use Koha::Database; Link Here
21
21
22
use base qw(Koha::Object);
22
use base qw(Koha::Object);
23
23
24
=head1 NAME
25
26
Koha::Localization - Koha Localization type Object class
27
28
=head1 API
29
30
=head2 Class methods
31
32
=cut
33
34
=head3 store
35
36
Localization specific store to ensure relevant caches are flushed on change
37
38
=cut
39
40
sub store {
41
    my ($self) = @_;
42
    $self = $self->SUPER::store;
43
44
    if ($self->entity eq 'itemtypes') {
45
        my $cache = Koha::Caches->get_instance();
46
        my $key = $self->lang."ItemTypeDescriptions";
47
        $cache->clear_from_cache($key);
48
    }
49
50
    return $self;
51
}
52
24
sub _type {
53
sub _type {
25
    return 'Localization';
54
    return 'Localization';
26
}
55
}
(-)a/admin/biblio_framework.pl (+2 lines)
Lines 80-85 if ( $op eq 'add_form' ) { Link Here
80
    $cache->clear_from_cache("MarcStructure-1-$frameworkcode");
80
    $cache->clear_from_cache("MarcStructure-1-$frameworkcode");
81
    $cache->clear_from_cache("default_value_for_mod_marc-");
81
    $cache->clear_from_cache("default_value_for_mod_marc-");
82
    $cache->clear_from_cache("MarcSubfieldStructure-$frameworkcode");
82
    $cache->clear_from_cache("MarcSubfieldStructure-$frameworkcode");
83
    $cache->clear_from_cache("MarcCodedFields-$frameworkcode");
83
    $op = 'list';
84
    $op = 'list';
84
} elsif ( $op eq 'delete_confirm' ) {
85
} elsif ( $op eq 'delete_confirm' ) {
85
    my $framework = Koha::BiblioFrameworks->find($frameworkcode);
86
    my $framework = Koha::BiblioFrameworks->find($frameworkcode);
Lines 111-116 if ( $op eq 'add_form' ) { Link Here
111
    $cache->clear_from_cache("MarcStructure-1-$frameworkcode");
112
    $cache->clear_from_cache("MarcStructure-1-$frameworkcode");
112
    $cache->clear_from_cache("default_value_for_mod_marc-");
113
    $cache->clear_from_cache("default_value_for_mod_marc-");
113
    $cache->clear_from_cache("MarcSubfieldStructure-$frameworkcode");
114
    $cache->clear_from_cache("MarcSubfieldStructure-$frameworkcode");
115
    $cache->clear_from_cache("MarcCodedFields-$frameworkcode");
114
    $op = 'list';
116
    $op = 'list';
115
}
117
}
116
118
(-)a/admin/marc_subfields_structure.pl (+2 lines)
Lines 309-314 elsif ( $op eq 'add_validate' ) { Link Here
309
    $cache->clear_from_cache("MarcStructure-1-$frameworkcode");
309
    $cache->clear_from_cache("MarcStructure-1-$frameworkcode");
310
    $cache->clear_from_cache("default_value_for_mod_marc-");
310
    $cache->clear_from_cache("default_value_for_mod_marc-");
311
    $cache->clear_from_cache("MarcSubfieldStructure-$frameworkcode");
311
    $cache->clear_from_cache("MarcSubfieldStructure-$frameworkcode");
312
    $cache->clear_from_cache("MarcCodedFields-$frameworkcode");
312
313
313
    print $input->redirect("/cgi-bin/koha/admin/marc_subfields_structure.pl?tagfield=$tagfield&frameworkcode=$frameworkcode");
314
    print $input->redirect("/cgi-bin/koha/admin/marc_subfields_structure.pl?tagfield=$tagfield&frameworkcode=$frameworkcode");
314
    exit;
315
    exit;
Lines 347-352 elsif ( $op eq 'delete_confirmed' ) { Link Here
347
    $cache->clear_from_cache("MarcStructure-1-$frameworkcode");
348
    $cache->clear_from_cache("MarcStructure-1-$frameworkcode");
348
    $cache->clear_from_cache("default_value_for_mod_marc-");
349
    $cache->clear_from_cache("default_value_for_mod_marc-");
349
    $cache->clear_from_cache("MarcSubfieldStructure-$frameworkcode");
350
    $cache->clear_from_cache("MarcSubfieldStructure-$frameworkcode");
351
    $cache->clear_from_cache("MarcCodedFields-$frameworkcode");
350
    print $input->redirect("/cgi-bin/koha/admin/marc_subfields_structure.pl?tagfield=$tagfield&frameworkcode=$frameworkcode");
352
    print $input->redirect("/cgi-bin/koha/admin/marc_subfields_structure.pl?tagfield=$tagfield&frameworkcode=$frameworkcode");
351
    exit;
353
    exit;
352
354
(-)a/admin/marctagstructure.pl (+2 lines)
Lines 155-160 if ($op eq 'add_form') { Link Here
155
    $cache->clear_from_cache("MarcStructure-1-$frameworkcode");
155
    $cache->clear_from_cache("MarcStructure-1-$frameworkcode");
156
    $cache->clear_from_cache("default_value_for_mod_marc-");
156
    $cache->clear_from_cache("default_value_for_mod_marc-");
157
    $cache->clear_from_cache("MarcSubfieldStructure-$frameworkcode");
157
    $cache->clear_from_cache("MarcSubfieldStructure-$frameworkcode");
158
    $cache->clear_from_cache("MarcCodedFields-$frameworkcode");
158
    print $input->redirect("/cgi-bin/koha/admin/marctagstructure.pl?searchfield=$tagfield&frameworkcode=$frameworkcode");
159
    print $input->redirect("/cgi-bin/koha/admin/marctagstructure.pl?searchfield=$tagfield&frameworkcode=$frameworkcode");
159
    exit;
160
    exit;
160
													# END $OP eq ADD_VALIDATE
161
													# END $OP eq ADD_VALIDATE
Lines 180-185 if ($op eq 'add_form') { Link Here
180
    $cache->clear_from_cache("MarcStructure-1-$frameworkcode");
181
    $cache->clear_from_cache("MarcStructure-1-$frameworkcode");
181
    $cache->clear_from_cache("default_value_for_mod_marc-");
182
    $cache->clear_from_cache("default_value_for_mod_marc-");
182
    $cache->clear_from_cache("MarcSubfieldStructure-$frameworkcode");
183
    $cache->clear_from_cache("MarcSubfieldStructure-$frameworkcode");
184
    $cache->clear_from_cache("MarcCodedFields-$frameworkcode");
183
    $template->param( searchfield => $searchfield );
185
    $template->param( searchfield => $searchfield );
184
													# END $OP eq DELETE_CONFIRMED
186
													# END $OP eq DELETE_CONFIRMED
185
################## ITEMTYPE_CREATE ##################################
187
################## ITEMTYPE_CREATE ##################################
(-)a/t/db_dependent/Koha/Filter/ExpandAuthorizedValues.t (-2 / +1 lines)
Lines 62-68 subtest 'ExpandAuthorizedValues tests' => sub { Link Here
62
    my $cache = Koha::Caches->get_instance;
62
    my $cache = Koha::Caches->get_instance;
63
    $cache->clear_from_cache("MarcStructure-0-");
63
    $cache->clear_from_cache("MarcStructure-0-");
64
    $cache->clear_from_cache("MarcStructure-1-");
64
    $cache->clear_from_cache("MarcStructure-1-");
65
    $cache->clear_from_cache("MarcAVStructure-1-");
65
    $cache->clear_from_cache("MarcCodedFields-");
66
    $cache->clear_from_cache("default_value_for_mod_marc-");
66
    $cache->clear_from_cache("default_value_for_mod_marc-");
67
    $cache->clear_from_cache("MarcSubfieldStructure-");
67
    $cache->clear_from_cache("MarcSubfieldStructure-");
68
68
69
- 

Return to bug 30848