From 3c074bffc24fa1435ebdffbb8d24be81191e5dfd Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Thu, 12 Dec 2019 13:30:43 +0000 Subject: [PATCH] Bug 22880: (follow-up) Process all installed languages, not just enabled Content-Type: text/plain; charset=utf-8 This patch changes the database update so that the system preference is copied to news items in all installed languages, not just those enabled in the OPAC. Signed-off-by: Lisette Scheer Signed-off-by: Marcel de Rooy --- .../atomicupdate/bug_22880-move-opacheader-to-news.perl | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/installer/data/mysql/atomicupdate/bug_22880-move-opacheader-to-news.perl b/installer/data/mysql/atomicupdate/bug_22880-move-opacheader-to-news.perl index 046f018be4..86888b8dcc 100644 --- a/installer/data/mysql/atomicupdate/bug_22880-move-opacheader-to-news.perl +++ b/installer/data/mysql/atomicupdate/bug_22880-move-opacheader-to-news.perl @@ -1,8 +1,17 @@ $DBversion = 'XXX'; # will be replaced by the RM if( CheckVersion( $DBversion ) ) { - my $opaclang = C4::Context->preference("opaclanguages"); + + # get list of installed translations + use C4::Languages qw(getTranslatedLanguages); my @langs; - push @langs, split ( '\,', $opaclang ); + my $tlangs = getTranslatedLanguages(); + + foreach my $language ( @$tlangs ) { + foreach my $sublanguage ( @{$language->{'sublanguages_loop'}} ) { + push @langs, $sublanguage->{'rfc4646_subtag'}; + } + } + # Get any existing value from the opacheader system preference my ($opacheader) = $dbh->selectrow_array( q| SELECT value FROM systempreferences WHERE variable='opacheader'; -- 2.11.0