Bugzilla – Attachment 156272 Details for
Bug 31383
Additional contents: We need a parent and child table
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 31383: Check lang and use right column in search_for_display
Bug-31383-Check-lang-and-use-right-column-in-searc.patch (text/plain), 1.80 KB, created by
Martin Renvoize (ashimema)
on 2023-09-27 10:01:44 UTC
(
hide
)
Description:
Bug 31383: Check lang and use right column in search_for_display
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2023-09-27 10:01:44 UTC
Size:
1.80 KB
patch
obsolete
>From edc806153fb0b0e55edc2b6827ef626e1b66d36e Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Thu, 22 Jun 2023 08:41:41 +0000 >Subject: [PATCH] Bug 31383: Check lang and use right column in > search_for_display > >We should check if $lang equals default before looking for translated >contents. >And note that @translated_content_id contains additional_content_id >not id, so cannot be used in the last query. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > Koha/AdditionalContents.pm | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > >diff --git a/Koha/AdditionalContents.pm b/Koha/AdditionalContents.pm >index a866aa71d0d..4b97fc1d837 100644 >--- a/Koha/AdditionalContents.pm >+++ b/Koha/AdditionalContents.pm >@@ -87,9 +87,9 @@ sub search_for_display { > my $contents = $self->SUPER::search( $search_params, { order_by => 'number' } ); > my @all_content_id = $contents->get_column('id'); > >- my @translated_content_id; >- if ( $params->{lang} ) { >- my $translated_contents = Koha::AdditionalContentsLocalizations->search( >+ my ( $translated_contents, @translated_content_id ); >+ if ( $params->{lang} && $params->{lang} ne 'default' ) { >+ $translated_contents = Koha::AdditionalContentsLocalizations->search( > { > additional_content_id => [$contents->get_column('id')], > lang => $params->{lang}, >@@ -107,7 +107,7 @@ sub search_for_display { > > return Koha::AdditionalContentsLocalizations->search( > { >- id => [@translated_content_id, $default_contents->get_column('id')] >+ id => [ $translated_contents ? $translated_contents->get_column('id') : (), $default_contents->get_column('id') ] > }, > ); > >-- >2.41.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 31383
:
147891
|
147892
|
147893
|
147894
|
147895
|
147896
|
149813
|
149814
|
149815
|
149816
|
149817
|
149818
|
152423
|
152424
|
152425
|
152426
|
152427
|
152428
|
152545
|
152546
|
152547
|
152566
|
152660
|
152661
|
152662
|
152663
|
152664
|
152665
|
152666
|
152667
|
152668
|
152669
|
153013
|
153666
|
153667
|
153668
|
153669
|
153670
|
153671
|
153672
|
153673
|
153674
|
153675
|
153676
|
156048
|
156049
|
156050
|
156051
|
156052
|
156053
|
156054
|
156055
|
156056
|
156057
|
156058
|
156265
|
156266
|
156267
|
156268
|
156269
|
156270
|
156271
|
156272
|
156273
|
156274
|
156275
|
156276
|
157539
|
157540
|
157541
|
157542
|
157543
|
157544
|
157545
|
157546
|
157547
|
157548
|
157549
|
157550
|
157580
|
157585
|
157640
|
157741
|
157742