Commit 1993b309 authored by Marcel de Rooy's avatar Marcel de Rooy Committed by Tomas Cohen Arazi

Bug 13050: Follow-up for bug 12371

This patch simplifies the SQL query in Letters.pm for table
borrower_modifications.
It also addresses the only case this query is used in opac-memberentry.
An unused variable in Letters.pm is removed.

Test plan:
Enable selfregistration on opac.
Set verification by email to required in prefs too.
Self-register two new users.
Check the email notices generated.
Verify the new users with the tokens in their notice.
Signed-off-by: Chris Cormack's avatarChris Cormack <chris@bigballofwax.co.nz>

Much cleaner SQL
Signed-off-by: Katrin Fischer's avatarKatrin Fischer <Katrin.Fischer.83@web.de>
Cleaner and works as described, no regressions found.
Passes tests and QA script.
Signed-off-by: Tomas Cohen Arazi's avatarTomas Cohen Arazi <tomascohen@gmail.com>
parent 66353372
......@@ -559,7 +559,6 @@ sub _substitute_tables {
$values = $param;
}
else {
my @pk;
my $sth = _parseletter_sth($table);
unless ($sth) {
warn "_parseletter_sth('$table') failed to return a valid sth. No substitution will be done for that table.";
......@@ -599,7 +598,7 @@ sub _parseletter_sth {
($table eq 'aqbooksellers') ? "SELECT * FROM $table WHERE id = ?" :
($table eq 'aqorders' ) ? "SELECT * FROM $table WHERE ordernumber = ?" :
($table eq 'opac_news' ) ? "SELECT * FROM $table WHERE idnew = ?" :
($table eq 'borrower_modifications') ? "SELECT * FROM $table WHERE ( borrowernumber = 0 OR borrowernumber = ? ) AND ( verification_token = '' OR verification_token = ? ) AND ( verification_token != '' OR borrowernumber != 0 )" :
($table eq 'borrower_modifications') ? "SELECT * FROM $table WHERE verification_token = ?" :
undef ;
unless ($query) {
warn "ERROR: No _parseletter_sth query for table '$table'";
......
......@@ -115,8 +115,7 @@ if ( $action eq 'create' ) {
module => 'members',
letter_code => 'OPAC_REG_VERIFY',
tables => {
borrower_modifications =>
[ $verification_token, $verification_token ],
borrower_modifications => $verification_token,
},
);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment