Description
Owen Leonard
2016-01-28 13:23:35 UTC
Working on Bug 15691 makes this problem very visible. Here are the minimum/maximum length hints for various values of CardnumberLength: "20" - "Card number can be up to 16 characters." "20,30" - "Card number must be between 20 and 16 characters." "40," - "Card number must be between 40 and 16 characters." > "40," - "Card number must be between 40 and 16 characters."
With the above setting you get a validation error, "Please enter at least 40 characters." Impossible because the maxlength of the field is 16.
Hi Owen Also I think IMHO this needs to update the CardnumberLength sypref to explain the maximum lenght allowed. Regards Created attachment 55540 [details] [review] Bug 15690: CardnumberLength should not be bigger than 16 borrowers.cardnumber is a varchar(16), so CardnumberLength should not have a max > 16 Test plan: Test different value in CardnumberLength ("20", "20,30", "40,") Edit a patron a make sure the text display under the cardnumber input is correct There is a discussion on devel list about card number length proposing to extend cardnumber field in borrowers table from VARCHAR(16) to VARCHAR(255) See: http://lists.koha-community.org/pipermail/koha-devel/2016-September/043049.html Created attachment 55573 [details] [review] Bug 15690: Hardcoded 16 is uncool Created attachment 55575 [details] [review] Bug 15690: CardnumberLength should not be bigger than 16 borrowers.cardnumber is a varchar(16), so CardnumberLength should not have a max > 16 Test plan: Test different value in CardnumberLength ("20", "20,30", "40,") Edit a patron a make sure the text display under the cardnumber input is correct Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Created attachment 55576 [details] [review] Bug 15690: Hardcoded 16 is uncool Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Created attachment 55620 [details] [review] Bug 15690: CardnumberLength should not be bigger than 16 borrowers.cardnumber is a varchar(16), so CardnumberLength should not have a max > 16 Test plan: Test different value in CardnumberLength ("20", "20,30", "40,") Edit a patron a make sure the text display under the cardnumber input is correct Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Marc <veron@veron.ch> Created attachment 55621 [details] [review] Bug 15690: Hardcoded 16 is uncool Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Followed test plan in comment #7, works as expectd. Signed-off-by: Marc <veron@veron.ch> On Jessie: DBIx::Class::Storage::DBI::_warn_undetermined_driver(): This version of DBIC does not yet seem to supply a driver for your particular RDBMS and/or connection method ('Mock'). While we will attempt to continue anyway, the results are likely to be underwhelming. Please upgrade DBIC, and if this message does not go away, file a bugreport including the following info: { DBD => "DBD::Mock", DBD_VER => "1.45", DBIC_DRIVER => "DBIx::Class::Storage::DBI", DBIC_DSN => "DBI:Mock:", DBIC_VER => "0.082810", DBI_VER => "1.631" } (In reply to Marcel de Rooy from comment #11) > On Jessie: > > DBIx::Class::Storage::DBI::_warn_undetermined_driver(): This version of DBIC > does not yet seem to supply a driver for your particular RDBMS and/or > connection method ('Mock'). While we will attempt to continue anyway, the > results are likely to be underwhelming. Please upgrade DBIC, and if this > message does not go away, file a bugreport including the following info: > { > DBD => "DBD::Mock", > DBD_VER => "1.45", > DBIC_DRIVER => "DBIx::Class::Storage::DBI", > DBIC_DSN => "DBI:Mock:", > DBIC_VER => "0.082810", > DBI_VER => "1.631" > } Yes this is a known bug, see https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14778#c44 (In reply to Jonathan Druart from comment #12) > Yes this is a known bug, see > https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14778#c44 Thx. Does the use of Test::DBIx::Class really outweigh its disadvantages (incl. a nasty install with a big bunch of dependencies)? (In reply to Marcel de Rooy from comment #13) > (In reply to Jonathan Druart from comment #12) > > Yes this is a known bug, see > > https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14778#c44 > > Thx. Does the use of Test::DBIx::Class really outweigh its disadvantages > (incl. a nasty install with a big bunch of dependencies)? Once we start using it, yeah. Created attachment 57462 [details] [review] Bug 15690: CardnumberLength should not be bigger than 16 borrowers.cardnumber is a varchar(16), so CardnumberLength should not have a max > 16 Test plan: Test different value in CardnumberLength ("20", "20,30", "40,") Edit a patron a make sure the text display under the cardnumber input is correct Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Marc <veron@veron.ch> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Created attachment 57463 [details] [review] Bug 15690: Hardcoded 16 is uncool Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Followed test plan in comment #7, works as expectd. Signed-off-by: Marc <veron@veron.ch> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Pushed to master for 16.11, thanks Jonathan and Mark! Pushed to 3.22.x, will be in 3.22.13 Pushed to 16.05.x, for 16.05.06 release |