Bugzilla – Attachment 155790 Details for
Bug 31503
Allow several consent types on the consents tab of OPAC account page
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 31503: (follow-up) Remove OPACCustomConsentTypes
Bug-31503-follow-up-Remove-OPACCustomConsentTypes.patch (text/plain), 6.29 KB, created by
Martin Renvoize (ashimema)
on 2023-09-18 09:57:23 UTC
(
hide
)
Description:
Bug 31503: (follow-up) Remove OPACCustomConsentTypes
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2023-09-18 09:57:23 UTC
Size:
6.29 KB
patch
obsolete
>From 8542adc7e684a4ea42e20269e664b5e8744aefa9 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Mon, 18 Sep 2023 10:28:06 +0100 >Subject: [PATCH] Bug 31503: (follow-up) Remove OPACCustomConsentTypes > >This patch removes all trace of the original OPACCustomConsentTypes >preference. We now use Koha::Plugins->feature_enabled in preference. > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > installer/data/mysql/atomicupdate/bug31503.pl | 8 +------- > installer/data/mysql/mandatory/sysprefs.sql | 1 - > .../prog/en/modules/admin/preferences/opac.pref | 9 --------- > t/db_dependent/Koha/Patron/Consents.t | 13 ++++++------- > 4 files changed, 7 insertions(+), 24 deletions(-) > >diff --git a/installer/data/mysql/atomicupdate/bug31503.pl b/installer/data/mysql/atomicupdate/bug31503.pl >index 5be62e73b82..2b4e55ece3e 100755 >--- a/installer/data/mysql/atomicupdate/bug31503.pl >+++ b/installer/data/mysql/atomicupdate/bug31503.pl >@@ -2,7 +2,7 @@ use Modern::Perl; > > return { > bug_number => 31503, >- description => "Change patron_consent.type, add pref OPACCustomConsentTypes", >+ description => "Change patron_consent.type", > up => sub { > my ($args) = @_; > my ( $dbh, $out ) = @$args{qw(dbh out)}; >@@ -11,11 +11,5 @@ return { > q{ALTER TABLE `patron_consent` MODIFY `type` tinytext COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'consent type, could be custom type'} > ); > say $out "Changed column 'patron_consent.type'"; >- >- $dbh->do( >- q{INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES >-('OPACCustomConsentTypes', '0', NULL, 'If enabled, custom consent types can be registered on account page', 'YesNo')} >- ); >- say $out "Addedd preference 'OPACCustomConsentTypes'"; > }, > }; >diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql >index 50f49994552..fad32d896e5 100644 >--- a/installer/data/mysql/mandatory/sysprefs.sql >+++ b/installer/data/mysql/mandatory/sysprefs.sql >@@ -445,7 +445,6 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('OpacCloud','0',NULL,'If ON, enables subject cloud on OPAC','YesNo'), > ('OpacAdditionalStylesheet','','','Define an auxiliary stylesheet for OPAC use, to override specified settings from the primary opac.css stylesheet. Enter the filename (if the file is in the server\'s css directory) or a complete URL beginning with http (if the file lives on a remote server).','free'), > ('OpacCoce','0', NULL, 'If on, enables cover retrieval from the configured Coce server in the OPAC', 'YesNo'), >-('OPACCustomConsentTypes', '0', NULL, 'If enabled, custom consent types can be registered on account page', 'YesNo'), > ('OPACCustomCoverImages','0',NULL,'If enabled, the custom cover images will be displayed at the OPAC. CustomCoverImagesURL must be defined.','YesNo'), > ('OPACdefaultSortField','relevance','relevance|popularity|call_number|pubdate|acqdate|title|author','Specify the default field used for sorting','Choice'), > ('OPACdefaultSortOrder','dsc','asc|dsc|za|az','Specify the default sort order','Choice'), >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref >index 496b6d6e19f..199a0615e18 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref >@@ -551,15 +551,6 @@ OPAC: > summary: "in user summary box on OPAC homepage (the system preference <em>OPACUserSummary</em> must be enabled)" > user: "on patron's 'your summary' page" > - ". Note that displayed savings may be inaccurate if checkout history is anonymized." >- - >- - pref: OPACCustomConsentTypes >- default: 0 >- choices: >- 1: Allow >- 0: "Don't allow" >- - "users to register consents for custom (plugin based) consent types on the user account page." >- - '<br><strong>NOTE</strong>: The consents tab is also visible when <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=PrivacyPolicyConsent">PrivacyPolicyConsent</a> is enabled.' >- > OpenURL: > - > - 'Complete URL of OpenURL resolver (starting with <code>http://</code> or <code>https://</code>):' >diff --git a/t/db_dependent/Koha/Patron/Consents.t b/t/db_dependent/Koha/Patron/Consents.t >index 4d2bf54d8fe..eeea426ab35 100755 >--- a/t/db_dependent/Koha/Patron/Consents.t >+++ b/t/db_dependent/Koha/Patron/Consents.t >@@ -54,6 +54,10 @@ subtest 'Method available_types' => sub { > plan tests => 7; > $schema->storage->txn_begin; > >+ t::lib::Mocks::mock_preference( 'PrivacyPolicyConsent', 'Enforced' ); >+ my $types = Koha::Patron::Consents->available_types; >+ is( keys %$types, 1, 'Expect one type for privacy policy' ); >+ > # Mock get_enabled_plugins > my $plugins = []; > my $plugins_module = Test::MockModule->new('Koha::Plugins'); >@@ -66,16 +70,11 @@ subtest 'Method available_types' => sub { > $plugin_2->mock( 'patron_consent_type', sub { return $data_2; } ); > $plugins = [ $plugin_1, $plugin_2 ]; > >- t::lib::Mocks::mock_preference( 'PrivacyPolicyConsent', 'Enforced' ); >- t::lib::Mocks::mock_preference( 'OPACCustomConsentTypes', 0 ); >- my $types = Koha::Patron::Consents->available_types; >- is( keys %$types, 1, 'Expect one plugin for privacy policy' ); >- t::lib::Mocks::mock_preference( 'OPACCustomConsentTypes', 1 ); > $types = Koha::Patron::Consents->available_types; >- is( keys %$types, 3, 'Expect three plugins when allowing custom consents' ); >+ is( keys %$types, 3, 'Expect three types when plugins installed and enabled' ); > t::lib::Mocks::mock_preference( 'PrivacyPolicyConsent', '' ); > $types = Koha::Patron::Consents->available_types; >- is( keys %$types, 2, 'Expect two plugins, when pref disabled' ); >+ is( keys %$types, 2, 'Expect two types, when plugins enabled but PrivacyPolicyConsent disabled' ); > is( $types->{GDPR_PROCESSING}, undef, 'GDPR key should not be found' ); > is_deeply( $types->{plugin_2}, $data_2->[1], 'Check type hash' ); > >-- >2.41.0
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 31503
:
140047
|
140048
|
140049
|
140050
|
140080
|
140081
|
140082
|
140083
|
140084
|
140085
|
140087
|
140088
|
140089
|
140090
|
140666
|
140667
|
140668
|
140669
|
140670
|
140671
|
140672
|
141216
|
141217
|
141218
|
141219
|
141220
|
141221
|
141222
|
141263
|
141264
|
141265
|
141266
|
141267
|
141268
|
141269
|
141302
|
141570
|
155000
|
155001
|
155002
|
155003
|
155177
|
155178
|
155179
|
155180
|
155189
|
155190
|
155191
|
155656
|
155657
|
155658
|
155659
|
155660
|
155661
|
155691
|
155694
|
155783
|
155784
|
155785
|
155786
|
155787
|
155788
|
155789
|
155790
|
155791
|
157117
|
157118
|
157119
|
157120
|
157121
|
157122
|
157123
|
157124
|
157125
|
157126
|
157773
|
157774
|
157775
|
157776
|
157777
|
157778
|
157779
|
157780
|
157781
|
157782
|
157783