OPACProblemReport text is truncated to 255 characters, in both database and email. I tested and confirmed that the patron-facing form does not limit the amount of text entered, at least not before more than 500 characters. The form should either limit characters and warn patrons of the character limit, or the database field should be expanded to allow more data storage.
Created attachment 117383 [details] [review] Bug 27726: Add maxlength attribute to OPACProblemReport textarea This patch adds a maxlength attribute to the OPACProblemReport textarea. This will prevent the user from entering more characters than the table column limit (255). To test, apply the patch and enable the OPACProblemReport system preference. - Log into the OPAC - Click the "Report a problem" link at the bottom of the page. - You should see a hint below the textarea, "255 characters maximum." - Enter enough text in the textarea to confirm that it is cut off at 255 characters.
Small note about testing, I didn't find "OPACProblemReport" in my sysprefs but found "OPACReportProblem" instead.
Created attachment 118020 [details] [review] Bug 27726: Add maxlength attribute to OPACProblemReport textarea This patch adds a maxlength attribute to the OPACProblemReport textarea. This will prevent the user from entering more characters than the table column limit (255). To test, apply the patch and enable the OPACProblemReport system preference. - Log into the OPAC - Click the "Report a problem" link at the bottom of the page. - You should see a hint below the textarea, "255 characters maximum." - Enter enough text in the textarea to confirm that it is cut off at 255 characters. Signed-off-by: Petro Vashchuk <stalkernoid@gmail.com>
Hmm, is this going the right way? 255 characters is around 50 words.. is that enough to describe your average problem? I wonder if we aught to increase the char count of the column in the db as well as Owens hinting (but obviously updated to the new char limit)
Created attachment 118811 [details] [review] Bug 27726: (ALTERNATIVE) Increase 'content' field size This alternate patch increases the field size from a 255 character varchar to a 65535 character text field. This allows for more detailed problem reports to be submitted.
Alternative attached that increases the storage size for the field instead.
Created attachment 118838 [details] [review] Bug 27726: Add maxlength attribute to OPACProblemReport textarea To test, apply the patch and enable the OPACProblemReport system preference. - Log into the OPAC - Click the "Report a problem" link at the bottom of the page. - You should see a hint below the textarea, "255 characters maximum." - Enter enough text in the textarea to confirm that it is cut off at 255 characters.
Created attachment 118839 [details] [review] Bug 27726: (ALTERNATIVE) Increase 'content' field size This alternate patch increases the field size from a 255 character varchar to a 65535 character text field. This allows for more detailed problem reports to be submitted.
Created attachment 118840 [details] [review] Bug 27726: Add maxlength attribute to OPACProblemReport textarea This patch adds a maxlength attribute to the OPACProblemReport textarea. This will prevent the user from entering more characters than the table column limit (255). To test, apply the patch and enable the OPACProblemReport system preference. - Log into the OPAC - Click the "Report a problem" link at the bottom of the page. - You should see a hint below the textarea, "255 characters maximum." - Enter enough text in the textarea to confirm that it is cut off at 255 characters. Signed-off-by: Amit Gupta <amitddng135@gmail.com> Signed-off-by: Petro Vashchuk <stalkernoid@gmail.com>
Created attachment 118841 [details] [review] Bug 27726: (ALTERNATIVE) Increase 'content' field size This alternate patch increases the field size from a 255 character varchar to a 65535 character text field. This allows for more detailed problem reports to be submitted. Signed-off-by: Amit Gupta <amitddng135@gmail.com> Signed-off-by: Petro Vashchuk <stalkernoid@gmail.com>
Created attachment 118905 [details] [review] Bug 27726: (ALTERNATIVE) Increase 'content' field size This alternate patch increases the field size from a 255 character varchar to a 65535 character text field. This allows for more detailed problem reports to be submitted. Signed-off-by: Amit Gupta <amitddng135@gmail.com> Signed-off-by: Petro Vashchuk <stalkernoid@gmail.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
I am in favor of the database change here. We don't have to worry about that space and I prefer people describing their problems without worrying about character limits :)
I am getting an error: {UNKNOWN}: DBI Exception: DBD::mysql::db do failed: BLOB/TEXT column 'content' can't have a default value [for Statement "ALTER TABLE problem_reports MODIFY content TEXT NOT NULL DEFAULT ''"] at /usr/share/perl5/DBIx/Class/Schema.pm line 1118.
(In reply to Jonathan Druart from comment #13) > I am getting an error: > > {UNKNOWN}: DBI Exception: DBD::mysql::db do failed: BLOB/TEXT column > 'content' can't have a default value [for Statement "ALTER TABLE > problem_reports MODIFY content TEXT NOT NULL DEFAULT ''"] at > /usr/share/perl5/DBIx/Class/Schema.pm line 1118. Interesting.. that's a super easy fix, just drop the default as it doesn't make sense anyway.. but I'm surprised you got that.. what SQL server are you using?
Same error: DEV atomic update: bug_27726.perl Atomic update generated errors: {UNKNOWN}: DBI Exception: DBD::mysql::db do failed: BLOB/TEXT column 'content' can't have a default value [for Statement "ALTER TABLE problem_reports MODIFY content TEXT NOT NULL DEFAULT ''"] at /usr/share/perl5/DBIx/Class/Schema.pm line 1118. DBIx::Class::Schema::throw_exception(Koha::Schema=HASH(0x562f6298c240), "DBI Exception: DBD::mysql::db do failed: BLOB/TEXT column 'co"...) called at /usr/share/perl5/DBIx/Class/Storage.pm line 113 DBIx::Class::Storage::throw_exception(DBIx::Class::Storage::DBI::mysql=HASH(0x562f62b267c8), "DBI Exception: DBD::mysql::db do failed: BLOB/TEXT column 'co"...) called at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line 1501 DBIx::Class::Storage::DBI::__ANON__("DBD::mysql::db do failed: BLOB/TEXT column 'content' can't ha"..., DBI::db=HASH(0x562f631329c0), undef) called at (eval 1457) line 3 eval '$DBversion = \'XXX\'; # will be replaced by the RM if( CheckVersion( $DBversion ) ) { $dbh->do("ALTER TABLE problem_reports MODIFY content TEXT NOT NULL DEFAULT \'\'"); NewVersion( $DBversion, 27726, "Increase field size for problem_reports.content"); } ' called at /kohadevbox/koha/installer/data/mysql/updatedatabase.pl line 23755 Server version: 10.1.48-MariaDB-1~bionic mariadb.org binary distribution
Created attachment 119344 [details] [review] Bug 27726: Increase 'content' field size This alternate patch increases the field size from a 255 character varchar to a 65535 character text field. This allows for more detailed problem reports to be submitted. Signed-off-by: Amit Gupta <amitddng135@gmail.com> Signed-off-by: Petro Vashchuk <stalkernoid@gmail.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Patch amended to drop the 'DEFAULT' definition.. worked in testing on the various Maria and MySQL versions available in k-t-d.
Pushed to master for 21.05, thanks to everybody involved!
Pushed to 20.11.x for 20.11.05
Pushed to 20.05.x for 20.05.11
Not backported to oldoldstable (19.11.x). Feel free to ask if it's needed.