Bugzilla – Attachment 27364 Details for
Bug 12100
Messaging preferences did not save Days in Advance
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[Signed-off] Bug 12100: Messaging preferences did not save Days in Advance
Signed-off-Bug-12100-Messaging-preferences-did-not.patch (text/plain), 3.42 KB, created by
Marc Véron
on 2014-04-21 17:58:27 UTC
(
hide
)
Description:
[Signed-off] Bug 12100: Messaging preferences did not save Days in Advance
Filename:
MIME Type:
Creator:
Marc Véron
Created:
2014-04-21 17:58:27 UTC
Size:
3.42 KB
patch
obsolete
>From 6566bc5fc3770d35529e18744e4a2ff342a22519 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Thu, 17 Apr 2014 13:30:44 +0200 >Subject: [PATCH] [Signed-off] Bug 12100: Messaging preferences did not save > Days in Advance >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >If you have enhanced messaging preference, the Days in Advance combo >value (in Patron Messaging Preferences) is saved in the database but >not retrieved when you have not enabled the Email checkbox next to it. > >This patch does the following: >[1] It replaces a JOIN by a LEFT JOIN that is the actual reason of the > problem described. >[2] Removes a FIXME by saving a hardcoded 30 into a constant. >[3] Fixes a typo in the neighborhood. >[4] Removes a superfluous comma in the map statement. >[5] Simplifies code for the selected field of the days combo. It should > just be a boolean. The text selected="selected" is in the template. > >Test plan: >[1] Enable enhanced messaging preferences. >[2] Fill in Days in advance for Advance notice but uncheck Email. >[3] Save the preferences. >[4] The member home screen does not display the number of days (until you > decide to apply this patch :) > >Followed test plan. Works as expected. >Signed-off-by: Marc Véron <veron@veron.ch> >--- > C4/Form/MessagingPreferences.pm | 10 ++++++---- > C4/Members/Messaging.pm | 2 +- > 2 files changed, 7 insertions(+), 5 deletions(-) > >diff --git a/C4/Form/MessagingPreferences.pm b/C4/Form/MessagingPreferences.pm >index fa3c303..328c55e 100644 >--- a/C4/Form/MessagingPreferences.pm >+++ b/C4/Form/MessagingPreferences.pm >@@ -25,9 +25,11 @@ use C4::Context; > use C4::Members::Messaging; > use C4::Debug; > >+use constant MAX_DAYS_IN_ADVANCE => 30; >+ > =head1 NAME > >-C4::Form::MessagingPreferences - manage messaging prefernces form >+C4::Form::MessagingPreferences - manage messaging preferences form > > =head1 SYNOPSIS > >@@ -134,10 +136,10 @@ sub set_form_values { > if ( $option->{'takes_days'} ) { > my $days_in_advance = $pref->{'days_in_advance'} ? $pref->{'days_in_advance'} : 0; > $option->{days_in_advance} = $days_in_advance; >- @{$option->{'select_days'}} = map {; { >+ @{$option->{'select_days'}} = map { { > day => $_, >- selected => $_ == $days_in_advance ? 'selected="selected"' :'' } >- } ( 0..30 ); # FIXME: 30 is a magic number. >+ selected => $_ == $days_in_advance } >+ } ( 0..MAX_DAYS_IN_ADVANCE ); > } > foreach my $transport ( keys %{$pref->{'transports'}} ) { > $option->{'transports_'.$transport} = 1; >diff --git a/C4/Members/Messaging.pm b/C4/Members/Messaging.pm >index 033c694..3cb6ae8 100644 >--- a/C4/Members/Messaging.pm >+++ b/C4/Members/Messaging.pm >@@ -74,7 +74,7 @@ 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 >-JOIN message_transports >+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 = ? >-- >1.7.10.4
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 12100
:
27234
|
27364
|
27627