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.

Signed-off-by: Lisette Scheer <lisettes@latahlibrary.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
Owen Leonard 2019-12-12 13:30:43 +00:00 committed by Martin Renvoize
parent 29bfa68800
commit f3b87f37dd
No known key found for this signature in database
GPG Key ID: 422B469130441A0F
1 changed files with 11 additions and 2 deletions

View File

@ -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';