Bugzilla – Attachment 188646 Details for
Bug 39721
Remove GetSuggestion from C4/Suggestions.pm
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 39721: fix suggestion_ref issues
Bug-39721-fix-suggestionref-issues.patch (text/plain), 2.24 KB, created by
Baptiste Wojtkowski (bwoj)
on 2025-10-30 13:31:10 UTC
(
hide
)
Description:
Bug 39721: fix suggestion_ref issues
Filename:
MIME Type:
Creator:
Baptiste Wojtkowski (bwoj)
Created:
2025-10-30 13:31:10 UTC
Size:
2.24 KB
patch
obsolete
>From dffb126025a8963716e531fc654bf432be72d458 Mon Sep 17 00:00:00 2001 >From: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com> >Date: Thu, 30 Oct 2025 13:28:46 +0000 >Subject: [PATCH] Bug 39721: fix suggestion_ref issues > >--- > suggestion/suggestion.pl | 14 ++++++++++++-- > 1 file changed, 12 insertions(+), 2 deletions(-) > >diff --git a/suggestion/suggestion.pl b/suggestion/suggestion.pl >index 27884d18a36..b6690624cca 100755 >--- a/suggestion/suggestion.pl >+++ b/suggestion/suggestion.pl >@@ -89,7 +89,9 @@ my $reasonsloop = GetAuthorisedValues("SUGGEST"); > > my $suggestion_ref = { $input->Vars }; > my $stored_suggestion; >-$stored_suggestion = Koha::Suggestions->find( $input->param('suggestionid') ) if $input->param('suggestionid'); >+unless ( $op eq "cud-update_status" ) { >+ $stored_suggestion = Koha::Suggestions->find( $input->param('suggestionid') ) if $input->param('suggestionid'); >+} > > delete $suggestion_ref->{$_} for qw(csrf_token suggestion_itemtype suggestion_managedby table_1_length); > >@@ -99,7 +101,14 @@ my $columns = ' ' . join( ' ', $schema->source('Suggestion')->columns ) > my $suggestion_only = { map { $columns =~ / $_ / ? ( $_ => $suggestion_ref->{$_} ) : () } keys %$suggestion_ref }; > $suggestion_only->{STATUS} = $suggestion_ref->{STATUS}; > >-qw( suggestedbyme op displayby tabcode notify filter_archived koha_login_context auth_forwarded_hash password userid ); >+delete $$suggestion_ref{$_} >+ foreach >+ qw( suggestedbyme op displayby tabcode notify filter_archived koha_login_context auth_forwarded_hash password userid ); >+ >+foreach my $key ( keys %$suggestion_ref ) { >+ delete $suggestion_ref->{$key} if ( !$suggestion_ref->{$key} && ( $op eq 'else' ) ); >+ delete $suggestion_ref->{$key} if $key =~ m{^DataTables_acqui_suggestions_suggestions}; >+} > > delete $suggestion_only->{branchcode} if $suggestion_only->{branchcode} eq '__ANY__'; > delete $suggestion_only->{budgetid} if $suggestion_only->{budgetid} eq '__ANY__'; >@@ -247,6 +256,7 @@ if ( $op =~ /cud-save/ ) { > > # empty fields, to avoid filter in "SearchSuggestion" > } >+ map { delete $$suggestion_ref{$_} unless $_ eq 'branchcode' } keys %$suggestion_ref; > $op = 'else'; > > if ( $redirect eq 'purchase_suggestions' ) { >-- >2.43.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 39721
:
181402
|
181416
|
182810
|
185280
|
185281
|
185282
|
185283
|
188646
|
188648
|
188649
|
188650
|
188651
|
188652