Bugzilla – Attachment 166894 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: Log creation on suggestion from staff or OPAC
Bug-35597-Log-creation-on-suggestion-from-staff-or.patch (text/plain), 2.09 KB, created by
Kyle M Hall (khall)
on 2024-05-17 12:48:34 UTC
(
hide
)
Description:
Bug 35597: Log creation on suggestion from staff or OPAC
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2024-05-17 12:48:34 UTC
Size:
2.09 KB
patch
obsolete
>From 3c359b5aa13a1f6bcbc6f69b552318e994cda3f1 Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >Date: Fri, 17 May 2024 08:12:57 -0400 >Subject: [PATCH] Bug 35597: Log creation on suggestion from staff or OPAC > >To test: >1. Apply patch, restart services, updatedatabase >2. Search for the system preference 'SuggestionsLog', it should be off. > Turn it on. >3. Create a purhase suggestion >4. Go to Tools > Log viewer. In modules check 'Suggestions' >5. You should see your newly created suggestion. >6. Create a suggestion from the OPAC. >7. You should see your newly created OPAC suggestion. >8. Modify the suggestion and check the logs again, the modification > should be logged. >9. Delete the suggestion, the deletion should be logged. >10. Do a purchase suggestion via the OPAC. >11 Check the logs to see the newly created suggestion, the interface > should be OPAC. >12. Turn off SuggestionsLog >13. No changes of any kind should be logged. > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> >Signed-off-by: Ray Delahunty <lib-systems@arts.ac.uk> > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > Koha/Suggestion.pm | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) > >diff --git a/Koha/Suggestion.pm b/Koha/Suggestion.pm >index a6dd3076719..3ba4bf75e3d 100644 >--- a/Koha/Suggestion.pm >+++ b/Koha/Suggestion.pm >@@ -70,6 +70,8 @@ sub store { > > my $emailpurchasesuggestions = C4::Context->preference("EmailPurchaseSuggestions"); > >+ my $new_suggestion = !$self->in_storage; >+ > my $result = $self->SUPER::store(); > if ( $emailpurchasesuggestions && $self->STATUS eq 'ASKED' ) { > >@@ -112,8 +114,9 @@ sub store { > ) or warn "can't enqueue letter $letter"; > } > } >- if (C4::Context->preference("NewsLog")) { >- logaction('SUGGESTION', 'CREATE', $result->suggestionid, '' ); >+ 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