Bugzilla – Attachment 128678 Details for
Bug 28698
News for all displays in all locations
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28698: Fix news for all displays in all locations
Bug-28698-Fix-news-for-all-displays-in-all-locatio.patch (text/plain), 1.97 KB, created by
Tomás Cohen Arazi (tcohen)
on 2021-12-17 15:29:11 UTC
(
hide
)
Description:
Bug 28698: Fix news for all displays in all locations
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2021-12-17 15:29:11 UTC
Size:
1.97 KB
patch
obsolete
>From 50abf06482fdae9e90ac2ee4920e9eda88195320 Mon Sep 17 00:00:00 2001 >From: Fridolin Somers <fridolin.somers@biblibre.com> >Date: Thu, 8 Jul 2021 22:33:03 -1000 >Subject: [PATCH] Bug 28698: Fix news for all displays in all locations > >Some news are used for custom text with a specific language, for example "opacheader". >The bug is that in these locations, news for all (staff and opac) are displayed. >This is because GetNewsToDisplay uses SQL : > opac_news.lang = '' OR opac_news.lang = ? > >This patch is a quick fix. >This feature maybe needs a big revamping. > >Test plan : >1) Remove any news >2) Create a news with empty 'Display location' and some content >3) Display OPAC interface >4) without patch you see in location of 'opacheader', 'opacnavright' ... the content > of the news >5) With patch you see content of the news only in news table >6) Create a news for opacheader >7) Check it appears in correct language > >Signed-off-by: David Nind <david@davidnind.com> >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > C4/NewsChannels.pm | 7 ++++--- > 1 file changed, 4 insertions(+), 3 deletions(-) > >diff --git a/C4/NewsChannels.pm b/C4/NewsChannels.pm >index 4b3c68311f..8c7aac738e 100644 >--- a/C4/NewsChannels.pm >+++ b/C4/NewsChannels.pm >@@ -226,13 +226,14 @@ sub GetNewsToDisplay { > OR expirationdate IS NULL > ) > AND published_on <= CURDATE() >- AND (opac_news.lang = '' OR opac_news.lang = ?) >+ AND (opac_news.lang = ? OR opac_news.lang = ?) > AND (opac_news.branchcode IS NULL OR opac_news.branchcode = ?) > ORDER BY number > }; > my $sth = $dbh->prepare($query); >- $lang = $lang // q{}; >- $sth->execute($lang,$branch); >+ my $lang1 = ( $lang =~ /_/ ) ? $lang : q{}; # lang contains also location >+ my $lang2 = $lang // q{}; >+ $sth->execute($lang1,$lang2,$branch); > my @results; > while ( my $row = $sth->fetchrow_hashref ){ > $row->{newdate} = output_pref({ dt => dt_from_string( $row->{newdate} ), dateonly => 1 }); >-- >2.32.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 28698
:
122698
|
128098
| 128678