Bugzilla – Attachment 126491 Details for
Bug 24223
Convert OpacNav system preference to news block
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24223: (QA follow-up) Do not copy to other languages
Bug-24223-QA-follow-up-Do-not-copy-to-other-langua.patch (text/plain), 3.18 KB, created by
Marcel de Rooy
on 2021-10-19 11:51:20 UTC
(
hide
)
Description:
Bug 24223: (QA follow-up) Do not copy to other languages
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2021-10-19 11:51:20 UTC
Size:
3.18 KB
patch
obsolete
>From 395c53e5f3ccc8383798ffdfea011fcc2d83acd4 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Tue, 19 Oct 2021 11:36:11 +0000 >Subject: [PATCH] Bug 24223: (QA follow-up) Do not copy to other languages >Content-Type: text/plain; charset=utf-8 > >By majority on Bugzilla, we dont want to have the existing text in all >translatable languages. > >Note: Removing the news_123 as code here, switching to OpacNav now. >Another report should handle/improve the use of code, assuming that >it is meant to provide some form of grouping. There is now confusion >between the fields code and location. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > .../bug_24223-move-opacnav-to-news.pl | 26 +++---------------- > 1 file changed, 3 insertions(+), 23 deletions(-) > >diff --git a/installer/data/mysql/atomicupdate/bug_24223-move-opacnav-to-news.pl b/installer/data/mysql/atomicupdate/bug_24223-move-opacnav-to-news.pl >index e0673876d5..45e0502fb5 100755 >--- a/installer/data/mysql/atomicupdate/bug_24223-move-opacnav-to-news.pl >+++ b/installer/data/mysql/atomicupdate/bug_24223-move-opacnav-to-news.pl >@@ -7,35 +7,15 @@ return { > my ($args) = @_; > my ($dbh, $out) = @$args{qw(dbh out)}; > >- # get list of installed translations >- require C4::Languages; >- my @langs; >- my $tlangs = C4::Languages::getTranslatedLanguages('opac','bootstrap'); >- >- foreach my $language ( @$tlangs ) { >- foreach my $sublanguage ( @{$language->{'sublanguages_loop'}} ) { >- push @langs, $sublanguage->{'rfc4646_subtag'}; >- } >- } >- >- # There must be a "default" entry in addition to language-specific ones >- push @langs, "default"; >- > # Get any existing value from the OpacNav system preference > my ($opacnav) = $dbh->selectrow_array( q| > SELECT value FROM systempreferences WHERE variable='OpacNav'; > |); > if( $opacnav ){ > # If there is a value in the OpacNav preference, insert it into additional_contents >- my $code = ''; >- foreach my $lang ( @langs ) { >- say $out "Inserting OpacNav contents into $lang news item..."; >- $dbh->do( "INSERT INTO additional_contents ( category, code, location, branchcode, title, content, lang, published_on ) VALUES ('html_customizations', '', 'OpacNav', NULL, ?, ?, ?, CAST(NOW() AS date) )", undef, "OpacNav $lang", $opacnav, $lang ); >- my $idnew = $dbh->last_insert_id(undef, undef, 'additional_contents', undef); >- if( $code eq '' ){ >- $code = "News_$idnew"; >- } >- $dbh->do(q|UPDATE additional_contents SET code=? WHERE idnew = ?|, undef, $code, $idnew); >+ foreach my $lang ( 'default' ) { >+ say $out "Inserting OpacNav contents into default"; >+ $dbh->do( "INSERT INTO additional_contents ( category, code, location, branchcode, title, content, lang, published_on ) VALUES ('html_customizations', 'OpacNav', 'OpacNav', NULL, ?, ?, ?, CAST(NOW() AS date) )", undef, "OpacNav $lang", $opacnav, $lang ); > } > > # Remove the OpacNav system preference >-- >2.20.1
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 24223
:
104362
|
104364
|
104453
|
109856
|
110843
|
110853
|
110897
|
110898
|
113130
|
113131
|
113132
|
115758
|
115759
|
115760
|
124935
|
124936
|
124937
|
124938
|
125300
|
125301
|
125302
|
125303
|
125304
|
125767
|
125768
|
125769
|
125770
|
125771
|
126089
|
126147
|
126484
|
126485
|
126486
|
126487
|
126488
|
126489
|
126490
|
126491
|
126492
|
127338
|
127343
|
127344
|
127345
|
127346