This bug enables logging modifications to the koha.borrower_messaging_preferences-table.
Created attachment 42482 [details] [review] Bug 14806 - Action Log for Modifying message_transport_types This is a crude fix. koha.action_logs-entries are generated when Borrower has been modified using C4::Form::MessagingPreferences log entries look like this: | MEMBERS | MOD MTT | All message_transports removed | MEMBERS | MOD MTT | [{'_name' => 'Advance_Notice','da' => '4','dig' => 1,'mtt' => ['email']},{'_name' => 'Item_Check_in','mtt' => ['email']},{'_name' => 'Item_Checkout','mtt' => ['email']}]
Created attachment 42483 [details] [review] Bug 14806 - Action Log for Modifying message_transport_types
Created attachment 42484 [details] [review] Bug 14806 - Action Log for Modifying message_transport_types
Created attachment 42485 [details] [review] Bug 14806 - Action Log for Modifying message_transport_types
Created attachment 42486 [details] [review] Bug 14806 - Action Log for Modifying message_transport_types TEST PLAN: 0. Activate system preference "BorrowersLog". 1. In intra, edit a Borrowers messaging preferences. 2. In OPAC remove your messaging preferences. 3. SELECT * FROM action_logs ORDER BY timestamp DESC LIMIT 5; 3.1. You should see your new action logs entries.
Created attachment 75399 [details] [review] Bug 14806 - (follow-up) Action Log for Modifying message_transport_types Introducing improvements: - Centralizing code into new Koha::Patron::Message::Preference(s) objects - Addings tests
Created attachment 75400 [details] [review] Bug 14806 - (follow-up) Action Log for Modifying message_transport_types Introducing improvements: - Centralizing code into new Koha::Patron::Message::Preference(s) objects - Addings tests
Created attachment 94749 [details] [review] Bug 14806 - Action Log for Modifying message_transport_types This is a crude fix. koha.action_logs-entries are generated when Borrower has been modified using C4::Form::MessagingPreferences log entries look like this: | MEMBERS | MOD MTT | All message_transports removed | MEMBERS | MOD MTT | [{'_name' => 'Advance_Notice','da' => '4','dig' => 1,'mtt' => ['email']},{'_name' => 'Item_Check_in','mtt' => ['email']},{'_name' => 'Item_Checkout','mtt' => ['email']}] TEST PLAN: 0. Activate system preference "BorrowersLog". 1. In intra, edit a Borrowers messaging preferences. 2. In OPAC remove your messaging preferences. 3. SELECT * FROM action_logs ORDER BY timestamp DESC LIMIT 5; 3.1. You should see your new action logs entries.
Created attachment 94750 [details] [review] Bug 14806 - (follow-up) Action Log for Modifying message_transport_types Introducing improvements: - Centralizing code into new Koha::Patron::Message::Preference(s) objects - Addings tests To test: 1. prove t/db_dependent/Koha/Patron/Message/Preferences.t 2. Follow test plan of previous patch Sponsored-by: Koha-Suomi Oy
Created attachment 94752 [details] [review] Bug 14806 - (follow-up) Action Log for Modifying message_transport_types Introducing improvements: - Centralizing code into new Koha::Patron::Message::Preference(s) objects - Addings tests To test: 1. prove t/db_dependent/Koha/Patron/Message/Preferences.t 2. Follow test plan of previous patch Sponsored-by: Koha-Suomi Oy
Patch no longer applies because of an issue with bug 18595: Applying: Bug 18595: Unit tests preparing for GetMessagingPreferences move Using index info to reconstruct a base tree... M t/db_dependent/Circulation.t M t/db_dependent/Reserves.t Falling back to patching base and 3-way merge... Auto-merging t/db_dependent/Reserves.t Auto-merging t/db_dependent/Circulation.t Applying: Bug 18595: Move C4::Members::Messaging::GetMessagingPreferences .git/rebase-apply/patch:146: trailing whitespace. This method defines how a user (or a default for a patron category) wants to get a certain .git/rebase-apply/patch:272: trailing whitespace. warning: 2 lines add whitespace errors. Using index info to reconstruct a base tree... M C4/Circulation.pm M C4/Reserves.pm M circ/returns.pl M misc/cronjobs/advance_notices.pl .git/rebase-apply/patch:146: trailing whitespace. This method defines how a user (or a default for a patron category) wants to get a certain .git/rebase-apply/patch:272: trailing whitespace. warning: 2 lines add whitespace errors. Falling back to patching base and 3-way merge... Auto-merging misc/cronjobs/advance_notices.pl CONFLICT (content): Merge conflict in misc/cronjobs/advance_notices.pl Auto-merging circ/returns.pl Auto-merging C4/Reserves.pm Auto-merging C4/Circulation.pm error: Failed to merge in the changes. Patch failed at 0001 Bug 18595: Move C4::Members::Messaging::GetMessagingPreferences The copy of the patch that failed is found in: .git/rebase-apply/patch When you have resolved this problem run "git bz apply --continue". If you would prefer to skip this patch, instead run "git bz apply --skip". To restore the original branch and stop patching run "git bz apply --abort". Patch left in /tmp/Bug-18595-Move-C4MembersMessagingGetMessagingPrefe-TcECxc.patch Cannot apply cleanly patches from bug 18595. Everything will be left dirty. git bz apply --continue will not continue the process if patches from other bug reports need to be applied.
Lari, are you still working on this? I'd love to see this enhancement!
Created attachment 162961 [details] [review] Bug 14806 - Log changes to borrower message preferences to action logs To test: 1. Change patron's messaging preference/preferences and save 2. Note no entries in patron's modification log 3. Apply patch 4. Change patron's messaging preference/preferences and save 5. Note entries in patron's modification log, one per message type
Mine's a bit hacky but does the job and the added code stays inside the module responsible for the modification process (Messaging.pm). The entries are not in line with other modification logs but they are readable :).
Lari, A couple things I see: 1. FAIL C4/Members/Messaging.pm FAIL pod coverage POD is missing for 'GetPatronMessagingPreferences' The new subroutine needs POD coverage. 2. Likely need unit test for sub GetPatronMessagingPreferences 3. Processing additional checks * Commit title does not start with 'Bug XXXXX: ' - 189e368f49