Bug 24447

Summary: POD of C4::Members::Messaging::GetMessagingPreferences() is misleading
Product: Koha Reporter: Magnus Enger <magnus>
Component: NoticesAssignee: Eden <eden.bacani>
Status: Pushed to oldoldstable --- QA Contact: Kyle M Hall <kyle>
Severity: minor    
Priority: P5 - low CC: andrew, caroline.cyr-la-rose, eden.bacani, fridolin.somers, jamespfk, kyle, victor
Version: masterKeywords: Academy
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18595
Change sponsored?: --- Patch complexity: Trivial patch
Text to go in the release notes:
Version(s) released in:
21.05.00,20.11.03,20.05.09,19.11.15
Attachments: Bug 24447: Changing 'DUE' to example in database that exists.
Bug 24447: Changing 'DUE' to example in database that exists.
Bug 24447: Changing 'DUE' to example in database that exists.

Description Magnus Enger 2020-01-17 12:22:52 UTC
Part of the POD for this subroutine looks like this:

  42   my $preferences = C4::Members::Messaging::GetMessagingPreferences( { borrowernumber => $borrower->{'borrowernumber'},
  43                                                                        message_name   => 'DUE' } );
  44 
  45   my $preferences = C4::Members::Messaging::GetMessagingPreferences( { categorycode => 'LIBRARY',
  46                                                                        message_name   => 'DUE' } );

It looks like the value for message_name should be a value from letter.code, but it should be a name from message_attributes.message_name:

  75 AND    message_transports.is_digest = borrower_message_preferences.wants_digest
  76 WHERE  message_attributes.message_name = ?
  77 END_SQL
  78 
  79     my @bind_params = ( $params->{'message_name'} );

Note: This subroutine is set to be renamed and moved by Bug 18595, but the POD seems to be untouched there.
Comment 1 Eden 2021-01-21 01:31:42 UTC
Created attachment 115484 [details] [review]
Bug 24447: Changing 'DUE' to example in database that exists.

Test Plan:
1.Using  perldoc C4/Members/Messaging.pm check that message_name
attribute name example  is Item_Due and not DUE.
Comment 2 Katrin Fischer 2021-01-21 19:28:46 UTC
Created attachment 115603 [details] [review]
Bug 24447: Changing 'DUE' to example in database that exists.

Test Plan:
1.Using  perldoc C4/Members/Messaging.pm check that message_name
attribute name example  is Item_Due and not DUE.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 3 Katrin Fischer 2021-01-21 19:29:39 UTC
Nice one, thx Eden!
Comment 4 Kyle M Hall 2021-01-21 19:37:09 UTC
Created attachment 115606 [details] [review]
Bug 24447: Changing 'DUE' to example in database that exists.

Test Plan:
1.Using  perldoc C4/Members/Messaging.pm check that message_name
attribute name example  is Item_Due and not DUE.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 5 Jonathan Druart 2021-01-22 13:53:49 UTC
Pushed to master for 21.05, thanks to everybody involved!
Comment 6 Fridolin Somers 2021-01-29 13:19:38 UTC
Pushed to 20.11.x for 20.11.03
Comment 7 Andrew Fuerste-Henry 2021-02-03 22:09:45 UTC
Pushed to 20.05.x for 20.05.09
Comment 8 Victor Grousset/tuxayo 2021-02-04 17:07:48 UTC
Backported: Pushed to 19.11.x branch for 19.11.15