From 395acbe291de7e4fcbff730926bec797f05196d2 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 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. --- .../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 bddef51a80c..a5b4bed507b 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