Summary: | Fatal database error when viewing Holds for Bib with no Items | ||
---|---|---|---|
Product: | Koha | Reporter: | David Cook <dcook> |
Component: | Hold requests | Assignee: | David Cook <dcook> |
Status: | CLOSED FIXED | QA Contact: | Testopia <testopia> |
Severity: | normal | ||
Priority: | P5 - low | CC: | bgkriegel, gmcharlt, kolpen, tomascohen |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | Small patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Circulation function: | |||
Attachments: |
Bug 12522 - Fatal database error when viewing Holds for Bib with no Items
[SIGNED-OFF] Bug 12522 - Fatal database error when viewing Holds for Bib with no Items [PASSED QA] Bug 12522 - Fatal database error when viewing Holds for Bib with no Items |
Description
David Cook
2014-07-03 06:30:32 UTC
Created attachment 29464 [details] [review] Bug 12522 - Fatal database error when viewing Holds for Bib with no Items This patch fixes some potential SQL syntax errors, which can cause fatal software errors in Koha when the environmental variable DEBUG is on. _TEST PLAN_ Before applying: 0) Ensure that you don't have "SetEnv DEBUG 1" in your Apache config 1) Create a new bib record 2) Click on the "Holds" tab before creating any items 3) Note the message "Cannot place hold: this record has no items attached." 4) Add "SetEnv DEBUG 1" to your Apache config 5) Restart Apache 6) Refresh your page 7) Note the following Software Error: "DBD::mysql::st execute failed: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')' at line 3 at /koha/lib/C4/Koha.pm line 835. 8) Apply the patch 9) Refresh your page 10) Note the message from Step 3 Thorough tester: 11) Remove "SetEnv DEBUG 1" from your Apache config, restart Apache, and refresh your page. You should see the message from Step 3. I suppose I should note that "Koha::get_infos_of" should probably be removed, and "C4::Items::GetItemInfosOf", and "C4::Biblio::GetBiblioItemInfosOf" should be refactored. (I should have probably included some explanatory comments in my patch as well, but...oh well.) *** Bug 8466 has been marked as a duplicate of this bug. *** Created attachment 29590 [details] [review] [SIGNED-OFF] Bug 12522 - Fatal database error when viewing Holds for Bib with no Items This patch fixes some potential SQL syntax errors, which can cause fatal software errors in Koha when the environmental variable DEBUG is on. _TEST PLAN_ Before applying: 0) Ensure that you don't have "SetEnv DEBUG 1" in your Apache config 1) Create a new bib record 2) Click on the "Holds" tab before creating any items 3) Note the message "Cannot place hold: this record has no items attached." 4) Add "SetEnv DEBUG 1" to your Apache config 5) Restart Apache 6) Refresh your page 7) Note the following Software Error: "DBD::mysql::st execute failed: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')' at line 3 at /koha/lib/C4/Koha.pm line 835. 8) Apply the patch 9) Refresh your page 10) Note the message from Step 3 Thorough tester: 11) Remove "SetEnv DEBUG 1" from your Apache config, restart Apache, and refresh your page. You should see the message from Step 3. Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Error reproduced, patch fixes it. Tested following test plan, no koha-qa errors. Created attachment 29632 [details] [review] [PASSED QA] Bug 12522 - Fatal database error when viewing Holds for Bib with no Items This patch fixes some potential SQL syntax errors, which can cause fatal software errors in Koha when the environmental variable DEBUG is on. _TEST PLAN_ Before applying: 0) Ensure that you don't have "SetEnv DEBUG 1" in your Apache config 1) Create a new bib record 2) Click on the "Holds" tab before creating any items 3) Note the message "Cannot place hold: this record has no items attached." 4) Add "SetEnv DEBUG 1" to your Apache config 5) Restart Apache 6) Refresh your page 7) Note the following Software Error: "DBD::mysql::st execute failed: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')' at line 3 at /koha/lib/C4/Koha.pm line 835. 8) Apply the patch 9) Refresh your page 10) Note the message from Step 3 Thorough tester: 11) Remove "SetEnv DEBUG 1" from your Apache config, restart Apache, and refresh your page. You should see the message from Step 3. Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Error reproduced, patch fixes it. Tested following test plan, no koha-qa errors. Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Patch pushed to master. Thanks David! |