Bugzilla – Attachment 90114 Details for
Bug 22908
Modsuggestion will generate a notice even if the modification failed
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22908: Prevent ModSuggestion to send a notice if something wrong happened
Bug-22908-Prevent-ModSuggestion-to-send-a-notice-i.patch (text/plain), 1.50 KB, created by
Marcel de Rooy
on 2019-05-27 09:53:00 UTC
(
hide
)
Description:
Bug 22908: Prevent ModSuggestion to send a notice if something wrong happened
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2019-05-27 09:53:00 UTC
Size:
1.50 KB
patch
obsolete
>From 3a31d108e79a32f6d75eea8d1196cb8991d6f0e5 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 14 May 2019 12:23:25 -0500 >Subject: [PATCH] Bug 22908: Prevent ModSuggestion to send a notice if > something wrong happened >Content-Type: text/plain; charset=utf-8 > >There is a return value $status_update_table that is set to 0, then we >send the alert (whatever the value of this variable). We must return >earlier if something happened! > >Test plan: >Not sure how to recreate it via the interface, so just run the tests? > >Signed-off-by: Liz Rea <wizzyrea@gmail.com> > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > C4/Suggestions.pm | 7 +++---- > 1 file changed, 3 insertions(+), 4 deletions(-) > >diff --git a/C4/Suggestions.pm b/C4/Suggestions.pm >index 71b9000574..05a7d20616 100644 >--- a/C4/Suggestions.pm >+++ b/C4/Suggestions.pm >@@ -544,11 +544,10 @@ sub ModSuggestion { > } > > my $rs = Koha::Database->new->schema->resultset('Suggestion')->find($suggestion->{suggestionid}); >- my $status_update_table = 1; >- eval { >+ eval { # FIXME Must raise an exception instead > $rs->update($suggestion); > }; >- $status_update_table = 0 if( $@ ); >+ return 0 if $@; > > if ( $suggestion->{STATUS} ) { > >@@ -584,7 +583,7 @@ sub ModSuggestion { > ) or warn "can't enqueue letter $letter"; > } > } >- return $status_update_table; >+ return 1; # No useful if the exception is raised earlier > } > > =head2 ConnectSuggestionAndBiblio >-- >2.11.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 22908
:
89765
|
89766
|
89792
|
89793
|
90113
| 90114