Bugzilla – Attachment 2717 Details for
Bug 4254
adding new patron advanced notice doesn't save
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
0001-Bug-4254-adding-new-patron-advanced-notice-doesn-t.patch (text/plain), 4.75 KB, created by
Chris Nighswonger
on 2010-10-30 06:29:03 UTC
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Chris Nighswonger
Created:
2010-10-30 06:29:03 UTC
Size:
4.75 KB
patch
obsolete
>From 85f10384776a1cd6f7ade41779a3b56fec4255ae Mon Sep 17 00:00:00 2001 >From: ByWater Solutions <brendan@bywatersolutions.com> >Date: Sat, 30 Oct 2010 00:17:56 -0600 >Subject: [PATCH] Bug 4254 - adding new patron advanced notice doesn't save > >This was due to poorly constructed SQL which returned duplicate values for >certain fields. This patch corrects that SQL. > >NOTE: There is also a formatting problem with the message prefs display table >when it is displayed in moremember.pl. This is due to there being no logic to >tell the table in that context to display checkboxes as appropriate. This patch >does not fix that. Bug 5328 has been opened for this problem. >--- > C4/Form/MessagingPreferences.pm | 3 +-- > C4/Members/Messaging.pm | 33 +++++++++++++++++---------------- > 2 files changed, 18 insertions(+), 18 deletions(-) > >diff --git a/C4/Form/MessagingPreferences.pm b/C4/Form/MessagingPreferences.pm >index bad3aa6..22b2048 100644 >--- a/C4/Form/MessagingPreferences.pm >+++ b/C4/Form/MessagingPreferences.pm >@@ -121,8 +121,7 @@ sub set_form_values { > # walk through the options and update them with these borrower_preferences > my $messaging_options = C4::Members::Messaging::GetMessagingOptions(); > PREF: foreach my $option ( @$messaging_options ) { >- my $pref = C4::Members::Messaging::GetMessagingPreferences( { %{ $target_params }, >- message_name => $option->{'message_name'} } ); >+ my $pref = C4::Members::Messaging::GetMessagingPreferences( { %{ $target_params }, message_name => $option->{'message_name'} } ); > # make a hashref of the days, selecting one. > if ( $option->{'takes_days'} ) { > my $days_in_advance = $pref->{'days_in_advance'} ? $pref->{'days_in_advance'} : 0; >diff --git a/C4/Members/Messaging.pm b/C4/Members/Messaging.pm >index 13b91fe..9dedf01 100644 >--- a/C4/Members/Messaging.pm >+++ b/C4/Members/Messaging.pm >@@ -61,21 +61,23 @@ sub GetMessagingPreferences { > > return unless exists $params->{message_name}; > return unless exists $params->{borrowernumber} xor exists $params->{categorycode}; # yes, xor >- > my $sql = <<'END_SQL'; >-SELECT borrower_message_preferences.*, >- borrower_message_transport_preferences.message_transport_type, >- message_attributes.*, >- message_transports.* >- FROM borrower_message_preferences >- LEFT JOIN borrower_message_transport_preferences >- ON borrower_message_transport_preferences.borrower_message_preference_id = borrower_message_preferences.borrower_message_preference_id >- LEFT JOIN message_attributes >- ON message_attributes.message_attribute_id = borrower_message_preferences.message_attribute_id >- LEFT JOIN message_transports >- ON message_transports.message_attribute_id = message_attributes.message_attribute_id >- AND message_transports.message_transport_type = borrower_message_transport_preferences.message_transport_type >- WHERE message_attributes.message_name = ? >+SELECT borrower_message_preferences.*, >+ borrower_message_transport_preferences.message_transport_type, >+ message_attributes.message_name, >+ message_attributes.takes_days, >+ message_transports.is_digest, >+ message_transports.letter_module, >+ message_transports.letter_code >+FROM borrower_message_preferences >+LEFT JOIN borrower_message_transport_preferences >+ON borrower_message_transport_preferences.borrower_message_preference_id = borrower_message_preferences.borrower_message_preference_id >+LEFT JOIN message_attributes >+ON message_attributes.message_attribute_id = borrower_message_preferences.message_attribute_id >+LEFT JOIN message_transports >+ON message_transports.message_attribute_id = message_attributes.message_attribute_id >+AND message_transports.message_transport_type = borrower_message_transport_preferences.message_transport_type >+WHERE message_attributes.message_name = ? > END_SQL > > my @bind_params = ( $params->{'message_name'} ); >@@ -93,10 +95,9 @@ END_SQL > my %transports; # helps build a list of unique message_transport_types > ROW: while ( my $row = $sth->fetchrow_hashref() ) { > next ROW unless $row->{'message_attribute_id'}; >- # warn( Data::Dumper->Dump( [ $row ], [ 'row' ] ) ); > $return->{'days_in_advance'} = $row->{'days_in_advance'} if defined $row->{'days_in_advance'}; > $return->{'wants_digest'} = $row->{'wants_digest'} if defined $row->{'wants_digest'}; >- $return->{'letter_code'} = $row->{'letter_code'}; >+ $return->{'letter_code'} = $row->{'letter_code'}; > $transports{$row->{'message_transport_type'}} = 1; > } > @{$return->{'transports'}} = keys %transports; >-- >1.5.6.5 >
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 4254
:
1954
|
1955
| 2717