[Bug 32674] New: When placing a hold in OPAC page explodes into error 500
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32674 Bug ID: 32674 Summary: When placing a hold in OPAC page explodes into error 500 Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: major Priority: P5 - low Component: OPAC Assignee: oleonard@myacpl.org Reporter: katrin.fischer@bsz-bw.de QA Contact: testopia@bugs.koha-community.org CC: jonathan.druart+koha@gmail.com When trying to place a hold on a record in the OPAC, we get an error 500 in 22.11.01. The error in the logs is: DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st execute failed: Column 'biblionumber' in where clause is ambiguous at /usr/share/koha/lib/Koha/Objects.pm line 394 With Joubu's help we tested following change that fixes the issue: opac/opac-reserve.pl, L.338 - biblionumber => $biblioNumber, + "me.biblionumber" => $biblionumber, There is no test plan as we haven't figured out yet, why this happens for some records and not for others. Items and records look normal, no hidden items on the record and no 773 etc. :) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32674 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |michaela.sieber@kit.edu -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32674 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |DUPLICATE Status|NEW |RESOLVED --- Comment #1 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- *** This bug has been marked as a duplicate of bug 32269 *** -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32674 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|DUPLICATE |--- Status|RESOLVED |REOPENED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32674 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|REOPENED |NEW -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32674 --- Comment #2 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- opac-detail.pl has 'me.biblionumber' => $biblionumber. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32674 --- Comment #3 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- To maybe find out more of what's going on: * Try emptying out OpacHiddenItems to see if it makes a difference * Try toggling hidelostitems * Get to the SQL query (hope I got these right): Change Koha/Database.pm: sub _new_schema { + $ENV{DBIC_TRACE} = 1; restart plack tail -f the log hit the page/create the error remove the DBIC_TRACE restart plack -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32674 Thomas Klausner <domm@plix.at> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |domm@plix.at --- Comment #4 from Thomas Klausner <domm@plix.at> --- Just a general DBIC-note: This problem is caused when joining tables and both tables have a column with the same name. As DBIC allows chaining of result-set/search calls, a given piece of code may work in one case, but not when later own the base query is amended and eg a second table is joined. Therefore it's (IMO) best pratice to always use the `me.` alias in DBIC searches, just to future-proof your code. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32674 --- Comment #5 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- There are more info on bug 33081, it's happening for serials. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32674 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |januszop@gmail.com --- Comment #6 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- *** Bug 33081 has been marked as a duplicate of this bug. *** -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32674 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32674 --- Comment #7 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 147479 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=147479&action=edit Bug 32674: Fix placing a hold at the OPAC for serials Placing a hold at the OPAC explodes with a 500 when the record is a serial DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st execute failed: Column 'biblionumber' in where clause is ambiguous at /usr/share/koha/lib/Koha/Objects.pm line 394 Test plan: Create a serial from a given biblio Place a hold on this record at the OPAC -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32674 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |31306 Severity|major |critical Assignee|oleonard@myacpl.org |jonathan.druart+koha@gmail. | |com Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31306 [Bug 31306] Add Koha::Items->search_ordered method -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32674 --- Comment #8 from Janusz Kaczmarek <januszop@gmail.com> --- Jonathan, thank you for identifying the duplicate. I wonder also if the first argument to search_ordered call should not be a anon. hash, like: my $items = Koha::Items->search_ordered( { -or => [ 'me.biblionumber' => $biblioNumber, 'me.itemnumber' => { -in => [ ..... ], }, since it is than passed to search? This would have been in my patch which I did not manage to send yesterday. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32674 --- Comment #9 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- (In reply to Janusz Kaczmarek from comment #8)
Jonathan, thank you for identifying the duplicate.
I wonder also if the first argument to search_ordered call should not be a anon. hash, like:
my $items = Koha::Items->search_ordered( { -or => [ 'me.biblionumber' => $biblioNumber, 'me.itemnumber' => { -in => [ ..... ], },
since it is than passed to search? This would have been in my patch which I did not manage to send yesterday.
They are identical constructs, it won't change anything. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32674 Janusz Kaczmarek <januszop@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #147479|0 |1 is obsolete| | --- Comment #10 from Janusz Kaczmarek <januszop@gmail.com> --- Created attachment 147481 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=147481&action=edit Bug 32674: Fix placing a hold at the OPAC for serials Placing a hold at the OPAC explodes with a 500 when the record is a serial DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st execute failed: Column 'biblionumber' in where clause is ambiguous at /usr/share/koha/lib/Koha/Objects.pm line 394 Test plan: Create a serial from a given biblio Place a hold on this record at the OPAC Signed-off-by: Janusz Kaczmarek <januszop@gmail.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32674 --- Comment #11 from Jonathan Druart <jonathan.druart+koha@gmail.com> ---
Signed-off-by: Janusz Kaczmarek <januszop@gmail.com>
Did you forget to change the status? :) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32674 Janusz Kaczmarek <januszop@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32674 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |katrin.fischer@bsz-bw.de |y.org | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32674 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32674 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #147481|0 |1 is obsolete| | --- Comment #12 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 147759 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=147759&action=edit Bug 32674: Fix placing a hold at the OPAC for serials Placing a hold at the OPAC explodes with a 500 when the record is a serial DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st execute failed: Column 'biblionumber' in where clause is ambiguous at /usr/share/koha/lib/Koha/Objects.pm line 394 Test plan: * Create a subscription for an existing bibliographic record * Place a hold on this record at the OPAC Signed-off-by: Janusz Kaczmarek <januszop@gmail.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32674 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #147759|0 |1 is obsolete| | --- Comment #13 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 147760 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=147760&action=edit Bug 32674: Fix placing a hold at the OPAC for serials Placing a hold at the OPAC explodes with a 500 when the record is a serial DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st execute failed: Column 'biblionumber' in where clause is ambiguous at /usr/share/koha/lib/Koha/Objects.pm line 394 Test plan: * Create a serial subscription for an existing bibliographic record * Place a hold on this record at the OPAC Signed-off-by: Janusz Kaczmarek <januszop@gmail.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32674 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to master Version(s)| |23.05.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32674 --- Comment #14 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Pushed to master for 23.05. Nice work everyone, thanks! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32674 Jacob O'Mara <jacob.omara@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to master |Pushed to stable Version(s)|23.05.00 |23.05.00,22.11.04 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32674 --- Comment #15 from Jacob O'Mara <jacob.omara@ptfs-europe.com> --- Nice work, thanks everyone! Pushed to 22.11.x for the next release. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32674 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lucas@bywatersolutions.com Resolution|--- |FIXED Status|Pushed to stable |RESOLVED --- Comment #16 from Lucas Gass <lucas@bywatersolutions.com> --- Missing dependencies for 22.05.x -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org