If a user attempts to log into the OPAC with the database admin account the following is generated: Software error: DBD::mysql::st execute failed: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 [for Statement "SELECT a.*, b.branchcode FROM alert a JOIN borrowers b USING(borrowernumber) WHERE"] at /home/mtompset/kohaclone/C4/Letters.pm line 331. For help, please send mail to the webmaster (webmaster@ubuntu), giving this error message and the time and date of the error. A tweak to the SQL and a warning would be nice, much like the Intranet warns those logging into the staff client with the database admin account.
Created attachment 52762 [details] [review] Bug 16805: Log in with database admin user breaks OPAC TEST PLAN --------- 1) Log into OPAC with database admin user. -- see error given in comment #0 2) Apply patch 3) Log into OPAC with database admin user. -- logs in, but gives warning with a nice logout button. 4) run koha qa test tools.
Created attachment 52764 [details] [review] [SIGNED-OFF]Bug 16805: Log in with database admin user breaks OPAC TEST PLAN --------- 1) Log into OPAC with database admin user. -- see error given in comment #0 2) Apply patch 3) Log into OPAC with database admin user. -- logs in, but gives warning with a nice logout button. 4) run koha qa test tools. Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com> No kaha qa errors In debian display diferent error: Can't use an undefined value as an ARRAY reference at /usr/lib/perl5/DBI.pm line 2054. Works as advertised
Created attachment 52827 [details] [review] Bug 16805: Add test to getalert (no param passed)
I'd not recommend to give such info on the public interface (You never know what might happen with students). Of course Koha is open source and we could trace back the error message, but... just in case :)
Created attachment 52845 [details] [review] Bug 16805: Add test to getalert (no param passed) TEST PLAN --------- 1) apply patch 2) prove t/db_dependent/Letters.t -- fails 3) run koha qa test tools Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Created attachment 52846 [details] [review] Bug 16805: Tweak new test message to say getalert It said 'addalert', which is likely a cut-paste typo. Plus, let's keep running the other tests if that one goes bad. TEST PLAN --------- 1) Apply Jonathan's test patch 2) prove t/db_dependent/Letters.t -- dies before finishing tests 3) Apply this test patch 4) prove t/db_dependent/Letters.t -- says 'getalert' -- fails on one test, but keeps going. 5) run koha qa test tools. Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Created attachment 52847 [details] [review] Bug 16805: Log in with database admin user breaks OPAC TEST PLAN --------- 1) Apply Jonathan's test patch 2) prove t/db_dependent/Letters.t -- dies before finishing tests 3) Apply second test patch 4) prove t/db_dependent/Letters.t -- says 'getalert' -- fails on one test, but keeps going. 5) Log into OPAC with database admin user. -- see error given in comment #0 6) Apply this patch 7) prove t/db_dependent/Letters.t -- says 'getalert' -- all tests pass. 8) Log into OPAC with database admin user. -- logs in, but gives warning with a nice logout button. 9) run koha qa test tools. Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com> No kaha qa errors In debian display diferent error: Can't use an undefined value as an ARRAY reference at /usr/lib/perl5/DBI.pm line 2054. Works as advertised NOTE: Revised test plan, as Jonathan added useful test case. Works as I've tested above. Hector tested older test plan which was steps 5,6,8 and 9. Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
(In reply to Jonathan Druart from comment #4) > I'd not recommend to give such info on the public interface (You never know > what might happen with students). > Of course Koha is open source and we could trace back the error message, > but... just in case :) Valid point, but who is going to hand out their database admin account to students?! This is more likely to be administrators (like me) being unwise and logging in with the database admin account. This, however, will be a huge security issue if some administrator somewhere has done this or will do this. So, I could understand QA wanting to revert the opac file changes in the third patch.
There is not point to catch the mysql error in the tests. It is going to be fixed by this patchset. The eval is not needed here. (In reply to M. Tompsett from comment #8) > So, I could understand QA wanting to revert the opac file changes in > the third patch. I suggested to replace it with something lighter: "You are not using a valid user". But nevermind, I won't fight ages for that.
Created attachment 52877 [details] [review] Bug 16805: Add test to getalert (no param passed) TEST PLAN --------- 1) apply patch 2) prove t/db_dependent/Letters.t -- fails 3) run koha qa test tools Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Created attachment 52878 [details] [review] Bug 16805: Tweak new test message to say getalert It said 'addalert', which is likely a cut-paste typo. Plus, let's keep running the other tests if that one goes bad. TEST PLAN --------- 1) Apply Jonathan's test patch 2) prove t/db_dependent/Letters.t -- dies before finishing tests 3) Apply this test patch 4) prove t/db_dependent/Letters.t -- still dies before finished tests, 'addalert' now is 'getalert' in message. 5) run koha qa test tools. Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Created attachment 52879 [details] [review] Bug 16805: Log in with database admin user breaks OPAC TEST PLAN --------- 1) Apply Jonathan's test patch 2) prove t/db_dependent/Letters.t -- dies before finishing tests 3) Apply second test patch 4) prove t/db_dependent/Letters.t -- dies before finishing tests -- 'addalert' is changed to 'getalert' 5) Log into OPAC with database admin user. -- see error given in comment #0 6) Apply this patch 7) prove t/db_dependent/Letters.t -- says 'getalert' -- all tests pass. 8) Log into OPAC with database admin user. -- logs in, but gives warning with a nice logout button. 9) run koha qa test tools. Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com> No kaha qa errors In debian display diferent error: Can't use an undefined value as an ARRAY reference at /usr/lib/perl5/DBI.pm line 2054. Works as advertised NOTE: Revised test plan, as Jonathan added useful test case. Works as I've tested above. Hector tested older test plan which was steps 5,6,8 and 9. Revised test plan again while tweaking to address comment #9. Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Created attachment 52880 [details] [review] Bug 16805: Add test to getalert (no param passed) TEST PLAN --------- 1) apply patch 2) prove t/db_dependent/Letters.t -- fails 3) run koha qa test tools Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Created attachment 52881 [details] [review] Bug 16805: Tweak new test message to say getalert It said 'addalert', which is likely a cut-paste typo. Plus, let's keep running the other tests if that one goes bad. TEST PLAN --------- 1) Apply Jonathan's test patch 2) prove t/db_dependent/Letters.t -- dies before finishing tests 3) Apply this test patch 4) prove t/db_dependent/Letters.t -- still dies before finished tests, 'addalert' now is 'getalert' in message. 5) run koha qa test tools. Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Created attachment 52882 [details] [review] Bug 16805: Log in with database admin user breaks OPAC TEST PLAN --------- 1) Apply Jonathan's test patch 2) prove t/db_dependent/Letters.t -- dies before finishing tests 3) Apply second test patch 4) prove t/db_dependent/Letters.t -- dies before finishing tests -- 'addalert' is changed to 'getalert' 5) Log into OPAC with database admin user. -- see error given in comment #0 6) Apply this patch 7) prove t/db_dependent/Letters.t -- says 'getalert' -- all tests pass. 8) Log into OPAC with database admin user. -- logs in, but gives warning with a nice logout button. 9) run koha qa test tools. Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com> No kaha qa errors In debian display diferent error: Can't use an undefined value as an ARRAY reference at /usr/lib/perl5/DBI.pm line 2054. Works as advertised NOTE: Revised test plan, as Jonathan added useful test case. Works as I've tested above. Hector tested older test plan which was steps 5,6,8 and 9. Revised test plan again while tweaking to address comment #9. Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Pushed to master for 16.11, thanks Jonathan, Mark!
Pushed in 16.05. Will be in 16.05.02.
Patches pushed to 3.22.x, will be in 3.22.10