When logged in to the OPAC and editing your personal details, you get an error trace if you enter a reasonable amount of text in the main address street number input field, for example: abcdefghijk. DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st execute failed: Data too long for column 'streetnumber' at row 1 at /kohadevbox/koha/Koha/Object.pm line 170 at /usr/share/perl5/DBIx/Class/Exception.pm line 77 in DBIx::Class::Exception::throw at /usr/share/perl5/DBIx/Class/Exception.pm line 77 74: my $self = { msg => $msg }; 75: bless $self => $class; 76: 77: die $self; 78: } 79: 80: =head2 rethrow Show function arguments To replicate: 1. Log in to the OPAC (I used koha and koha with KTD). 2. Go to Your account > Personal details 3. Enter abcdefghijk in the Main address > Street number input field. 4. Error trace occurs. 5. Enter abcdefghij in the Main address > Street number input field. 6. Form submitted.
Created attachment 145379 [details] [review] Bug 32663: Limit streetnumber to 10 characters in OPAC This change harmonizes the patron streetnumber input between the staff interface and the OPAC, so that you can only enter 10 characters into the streetnumber for the OPAC. Without this change, a fatal error will be thrown trying to save the too long data. Test plan: 0. Apply the patch 1. Go to http://localhost:8080/cgi-bin/koha/opac-memberentry.pl 2. Note that you can only enter 10 characters into the "Street number" field as a self-registration patron 3. Log into Koha 4. Go to http://localhost:8080/cgi-bin/koha/opac-memberentry.pl 5. Note that you can only enter 10 characters into the "Street number" field when editing logged in patron details too 6. Go to http://localhost:8081/cgi-bin/koha/members/memberentry.pl?op=add&categorycode=S 7. Note that you can only enter 10 characters into the "Street number" field as a staff member
Created attachment 145381 [details] [review] Bug 32663: Limit streetnumber to 10 characters in OPAC This change harmonizes the patron streetnumber input between the staff interface and the OPAC, so that you can only enter 10 characters into the streetnumber for the OPAC. Without this change, a fatal error will be thrown trying to save the too long data. Test plan: 0. Apply the patch 1. Go to http://localhost:8080/cgi-bin/koha/opac-memberentry.pl 2. Note that you can only enter 10 characters into the "Street number" field as a self-registration patron 3. Log into Koha 4. Go to http://localhost:8080/cgi-bin/koha/opac-memberentry.pl 5. Note that you can only enter 10 characters into the "Street number" field when editing logged in patron details too 6. Go to http://localhost:8081/cgi-bin/koha/members/memberentry.pl?op=add&categorycode=S 7. Note that you can only enter 10 characters into the "Street number" field as a staff member Signed-off-by: David Nind <david@davidnind.com>
Created attachment 145879 [details] [review] Bug 32663: Limit streetnumber to 10 characters in OPAC This change harmonizes the patron streetnumber input between the staff interface and the OPAC, so that you can only enter 10 characters into the streetnumber for the OPAC. Without this change, a fatal error will be thrown trying to save the too long data. Test plan: 0. Apply the patch 1. Go to http://localhost:8080/cgi-bin/koha/opac-memberentry.pl 2. Note that you can only enter 10 characters into the "Street number" field as a self-registration patron 3. Log into Koha 4. Go to http://localhost:8080/cgi-bin/koha/opac-memberentry.pl 5. Note that you can only enter 10 characters into the "Street number" field when editing logged in patron details too 6. Go to http://localhost:8081/cgi-bin/koha/members/memberentry.pl?op=add&categorycode=S 7. Note that you can only enter 10 characters into the "Street number" field as a staff member Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Solene Ngamga <solene.ngamga@inLibro.com>
`streetnumber` tinytext DEFAULT NULL COMMENT 'the house number for your patron/borrower''s primary address', Are we going the right direction here?
(In reply to Marcel de Rooy from comment #4) > `streetnumber` tinytext DEFAULT NULL COMMENT 'the house number for your > patron/borrower''s primary address', > > Are we going the right direction here? Perhaps not. Looks like borrower_modifications is out of sync with borrowers and deletedborrowers. Looks like many fields in borrower_modifications have the wrong type: streetnumber, streettype, zipcode, mobile, B_streetnumber, B_streettype, B_address, B_zipcode, password, altcontactfirstname, altcontactsurname, altcontactaddress1, altcontactaddress2, altcontactaddress3, altcontactzipcode, altcontactphone
(In reply to David Cook from comment #5) > (In reply to Marcel de Rooy from comment #4) > > `streetnumber` tinytext DEFAULT NULL COMMENT 'the house number for your > > patron/borrower''s primary address', > > > > Are we going the right direction here? > > Perhaps not. > > Looks like borrower_modifications is out of sync with borrowers and > deletedborrowers. > > Looks like many fields in borrower_modifications have the wrong type: > streetnumber, streettype, zipcode, mobile, B_streetnumber, B_streettype, > B_address, B_zipcode, password, altcontactfirstname, altcontactsurname, > altcontactaddress1, altcontactaddress2, altcontactaddress3, > altcontactzipcode, altcontactphone At least that's in kohastructure.sql. I am not sure about an upgraded database. Yikes...
I believe the discussion about harmonizing the datatypes would be better moved elsewhere so we can proceed with this patch that brings the form in line with the form in the staff interface. A simple change that will help avoid issues for now and add to consistency.
Created attachment 147421 [details] [review] Bug 32663: Limit streetnumber to 10 characters in OPAC This change harmonizes the patron streetnumber input between the staff interface and the OPAC, so that you can only enter 10 characters into the streetnumber for the OPAC. Without this change, a fatal error will be thrown trying to save the too long data. Test plan: 0. Apply the patch 1. Go to http://localhost:8080/cgi-bin/koha/opac-memberentry.pl 2. Note that you can only enter 10 characters into the "Street number" field as a self-registration patron 3. Log into Koha 4. Go to http://localhost:8080/cgi-bin/koha/opac-memberentry.pl 5. Note that you can only enter 10 characters into the "Street number" field when editing logged in patron details too 6. Go to http://localhost:8081/cgi-bin/koha/members/memberentry.pl?op=add&categorycode=S 7. Note that you can only enter 10 characters into the "Street number" field as a staff member Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Solene Ngamga <solene.ngamga@inLibro.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Pushed to master for 23.05. Nice work everyone, thanks!
Nice work everyone! Pushed to stable for 22.11.x
Backported to 22.05.x for upcoming 22.05.11
applied to 21.11 for 21.11.19
Not backported to 21.05.x