Skip to content

Commit

Permalink
Bug 11693: Default emailing preferences not loaded for self registeri…
Browse files Browse the repository at this point in the history
…ng patron

The call to AddMember_Opac does not take care of the messaging prefs
when enhanced messaging is enabled.
This patch adds the call to handle_form_action to do that.

Test plan:
Enable self registering patrons and enhanced messaging.
Check the (default) message prefs for the relevant patron category. At least
enable email for one notice.
Self-register a user with and without verification email enabled.
Check in both cases that the message prefs of the user conform to
those in the patron category. (So at least one enabled.)

Followed test plan, works as expected.
Signed-off-by: Marc Véron <[email protected]>

Signed-off-by: Jonathan Druart <[email protected]>
Signed-off-by: Tomas Cohen Arazi <[email protected]>
  • Loading branch information
mderooy authored and tomascohen committed Jul 24, 2015
1 parent 2eded5f commit f7ed250
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions opac/opac-memberentry.pl
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
use C4::Auth;
use C4::Output;
use C4::Members;
use C4::Form::MessagingPreferences;
use Koha::Borrower::Modifications;
use C4::Branch qw(GetBranchesLoop);
use C4::Scrubber;
Expand Down Expand Up @@ -146,6 +147,7 @@
C4::Context->preference('OpacPasswordChange') );

my ( $borrowernumber, $password ) = AddMember_Opac(%borrower);
C4::Form::MessagingPreferences::handle_form_action($cgi, { borrowernumber => $borrowernumber }, $template, 1, C4::Context->preference('PatronSelfRegistrationDefaultCategory') ) if $borrowernumber && C4::Context->preference('EnhancedMessagingPreferences');

$template->param( password_cleartext => $password );
$template->param(
Expand Down
2 changes: 2 additions & 0 deletions opac/opac-registration-verify.pl
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
use C4::Auth;
use C4::Output;
use C4::Members;
use C4::Form::MessagingPreferences;
use Koha::Borrower::Modifications;

my $cgi = new CGI;
Expand Down Expand Up @@ -56,6 +57,7 @@

if ($borrowernumber) {
Koha::Borrower::Modifications->DelModifications({ verification_token => $token });
C4::Form::MessagingPreferences::handle_form_action($cgi, { borrowernumber => $borrowernumber }, $template, 1, C4::Context->preference('PatronSelfRegistrationDefaultCategory') ) if C4::Context->preference('EnhancedMessagingPreferences');

$template->param( password_cleartext => $password );
$template->param(
Expand Down

0 comments on commit f7ed250

Please sign in to comment.