[Bug 34338] New: Cardnumbers should be trimmed before insertion
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34338 Bug ID: 34338 Summary: Cardnumbers should be trimmed before insertion Change sponsored?: --- Product: Koha Version: unspecified Hardware: All OS: All Status: ASSIGNED Severity: major Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: jonathan.druart+koha@gmail.com Reporter: jonathan.druart+koha@gmail.com QA Contact: testopia@bugs.koha-community.org Depends on: 33940 You can set cardnumber to NULL even if not allowed Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33940 [Bug 33940] Move get_cardnumber_length and checkcardnumber to Koha -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34338 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |katrin.fischer@bsz-bw.de, | |m.de.rooy@rijksmuseum.nl Status|ASSIGNED |In Discussion --- Comment #1 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- commit 785af7310daa4633359755add9474e81f108d022 Bug 6521 - allow blank cardnumbers to not trigger "already in use" + # If the cardnumber is blank, treat it as null. + $newdata{'cardnumber'} = undef if $newdata{'cardnumber'} =~ /^\s*$/; What's the expected behaviour? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34338 --- Comment #2 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 153774 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=153774&action=edit Bug 34338: Do not allow spaces in cardnumber -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34338 --- Comment #3 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Hum see comment 1. What's the expected behaviour? Should we keep the "if blank treat as null" in memberentry.pl for staff, but reject in other places? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34338 --- Comment #4 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Jonathan Druart from comment #3)
Hum see comment 1. What's the expected behaviour? Should we keep the "if blank treat as null" in memberentry.pl for staff, but reject in other places?
No we should reject it too. But something strange is going on here in the direct context: my $new_barcode = $newdata{'cardnumber'}; Koha::Plugins->call( 'patron_barcode_transform', \$new_barcode ); $newdata{'cardnumber'} = $new_barcode; That is interfering with our new logic here. Does not look good to me. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34338 --- Comment #5 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- koha-tmpl/intranet-tmpl/prog/en/includes/onboarding_messages.inc Card number contains whitespaces koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt Cardnumber already contains whitespaces. koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt [% ELSIF cardnumber_not_trimmed %] <a href="#borrower_cardnumber"><strong>The entered card number contains whitespaces.</strong></a> Three different strings. And they are not exact. We dont like leading or trailing whitespace. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34338 --- Comment #6 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 153967 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=153967&action=edit Bug 34338: Do not allow leading or trailing whitespaces in cardnumber -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34338 --- Comment #7 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- (In reply to Marcel de Rooy from comment #5)
koha-tmpl/intranet-tmpl/prog/en/includes/onboarding_messages.inc Card number contains whitespaces
koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt Cardnumber already contains whitespaces.
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt [% ELSIF cardnumber_not_trimmed %] <a href="#borrower_cardnumber"><strong>The entered card number contains whitespaces.</strong></a>
Three different strings. And they are not exact. We dont like leading or trailing whitespace.
Fixed. There are still 2 different messages, to match the other strings in the same files. (In reply to Marcel de Rooy from comment #4)
(In reply to Jonathan Druart from comment #3)
Hum see comment 1. What's the expected behaviour? Should we keep the "if blank treat as null" in memberentry.pl for staff, but reject in other places?
No we should reject it too.
It's not clear to me if we want to introduce a behaviour change here.
But something strange is going on here in the direct context:
my $new_barcode = $newdata{'cardnumber'}; Koha::Plugins->call( 'patron_barcode_transform', \$new_barcode );
$newdata{'cardnumber'} = $new_barcode;
That is interfering with our new logic here. Does not look good to me.
I don't understand what you mean, can you explain a bit more? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34338 --- Comment #8 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Jonathan Druart from comment #7)
It's not clear to me if we want to introduce a behaviour change here. Please explain that will be the benefits of keeping this 'behavior'.
But something strange is going on here in the direct context:
my $new_barcode = $newdata{'cardnumber'}; Koha::Plugins->call( 'patron_barcode_transform', \$new_barcode );
$newdata{'cardnumber'} = $new_barcode;
That is interfering with our new logic here. Does not look good to me.
I don't understand what you mean, can you explain a bit more?
Plugin is called apparently based on cardnumber. But stores info in cardnumber. Should be barcode, right? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34338 --- Comment #9 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- If there are no plugins, cardnumber is undef ?? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34338 --- Comment #10 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- (In reply to Marcel de Rooy from comment #8)
(In reply to Jonathan Druart from comment #7)
It's not clear to me if we want to introduce a behaviour change here. Please explain that will be the benefits of keeping this 'behavior'.
But something strange is going on here in the direct context:
my $new_barcode = $newdata{'cardnumber'}; Koha::Plugins->call( 'patron_barcode_transform', \$new_barcode );
$newdata{'cardnumber'} = $new_barcode;
That is interfering with our new logic here. Does not look good to me.
I don't understand what you mean, can you explain a bit more?
Plugin is called apparently based on cardnumber. But stores info in cardnumber. Should be barcode, right?
barcode==cardnumber here (In reply to Marcel de Rooy from comment #9)
If there are no plugins, cardnumber is undef ??
No, it's just not modified. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34338 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #153774|0 |1 is obsolete| | Attachment #153967|0 |1 is obsolete| | --- Comment #11 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 153972 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=153972&action=edit Bug 34338: Do not allow leading or trailing whitespaces in cardnumber -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34338 Bug 34338 depends on bug 33940, which changed state. Bug 33940 Summary: Move get_cardnumber_length and checkcardnumber to Koha https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33940 What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to master |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org