Bugzilla – Attachment 166896 Details for
Bug 35597
Purchase suggestion changes aren't logged
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35597: Move modification logging to Koha::Suggestion
Bug-35597-Move-modification-logging-to-KohaSuggest.patch (text/plain), 1.94 KB, created by
Kyle M Hall (khall)
on 2024-05-17 12:48:39 UTC
(
hide
)
Description:
Bug 35597: Move modification logging to Koha::Suggestion
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2024-05-17 12:48:39 UTC
Size:
1.94 KB
patch
obsolete
>From b07a537740705ac0fd5e3262076c5ac0a598e6bc Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Fri, 17 May 2024 08:46:30 -0400 >Subject: [PATCH] Bug 35597: Move modification logging to Koha::Suggestion > >Some actions such as archiving a suggestion were not being logged. >By moving the logging to Koha::Suggestion we can ensure more >modifcations will be logged. > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > C4/Suggestions.pm | 4 +--- > Koha/Suggestion.pm | 11 +++++++---- > 2 files changed, 8 insertions(+), 7 deletions(-) > >diff --git a/C4/Suggestions.pm b/C4/Suggestions.pm >index 7ba21860d26..ed3a19bcfda 100644 >--- a/C4/Suggestions.pm >+++ b/C4/Suggestions.pm >@@ -294,9 +294,7 @@ sub ModSuggestion { > ) or warn "can't enqueue letter $letter"; > } > } >- if ( C4::Context->preference("SuggestionsLog") ) { >- logaction( 'SUGGESTION', 'MODIFY', $suggestion->{suggestionid}, $suggestion_object ); >- } >+ > return 1; # No useful if the exception is raised earlier > } > >diff --git a/Koha/Suggestion.pm b/Koha/Suggestion.pm >index 3ba4bf75e3d..66c70e12779 100644 >--- a/Koha/Suggestion.pm >+++ b/Koha/Suggestion.pm >@@ -73,6 +73,12 @@ sub store { > my $new_suggestion = !$self->in_storage; > > my $result = $self->SUPER::store(); >+ >+ if ( C4::Context->preference("SuggestionsLog") ) { >+ my $action = $new_suggestion ? 'CREATE' : 'MODIFY'; >+ logaction( 'SUGGESTION', $action, $result->suggestionid, $self ); >+ } >+ > if ( $emailpurchasesuggestions && $self->STATUS eq 'ASKED' ) { > > if ( >@@ -114,10 +120,7 @@ sub store { > ) or warn "can't enqueue letter $letter"; > } > } >- my $suggestion_object = Koha::Suggestions->find( $result->suggestionid ); >- if ( $new_suggestion && C4::Context->preference("SuggestionsLog") ) { >- logaction( 'SUGGESTION', 'CREATE', $result->suggestionid, $suggestion_object ); >- } >+ > return $result; > } > >-- >2.30.2
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 35597
:
160223
|
160253
|
160265
|
161114
|
161115
|
161116
|
164536
|
164537
|
166890
|
166891
|
166892
|
166893
|
166894
|
166895
| 166896