[Bug 36317] New: Koha::Biblio->host_items fails with search_ordered()
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36317 Bug ID: 36317 Summary: Koha::Biblio->host_items fails with search_ordered() Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: koha-bugs@lists.koha-community.org Reporter: fridolin.somers@biblibre.com QA Contact: testopia@bugs.koha-community.org Koha::Biblio->host_items fails with search_ordered() because of ambiguous column 'itemnumber' in where clause. It must use me.itemnumber like in Koha::Biblio->items -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36317 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |fridolin.somers@biblibre.co |ity.org |m Status|NEW |ASSIGNED --- Comment #1 from Fridolin Somers <fridolin.somers@biblibre.com> --- Used for example in Bug 24192 -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36317 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=24192 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36317 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=34360 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36317 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |31306 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=36317 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff Patch complexity|--- |Trivial patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36317 --- Comment #2 from Fridolin Somers <fridolin.somers@biblibre.com> --- Created attachment 163131 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=163131&action=edit Bug 36317: Koha::Biblio->host_items must use me.itemnumber Koha::Biblio->host_items fails with search_ordered() because of ambiguous column 'itemnumber' in where clause. It must use me.itemnumber like in Koha::Biblio->items Test plan : prove t/db_dependent/Biblio.t -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36317 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36317 David Nind <david@davidnind.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=36317 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #163131|0 |1 is obsolete| | --- Comment #3 from David Nind <david@davidnind.com> --- Created attachment 163155 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=163155&action=edit Bug 36317: Koha::Biblio->host_items must use me.itemnumber Koha::Biblio->host_items fails with search_ordered() because of ambiguous column 'itemnumber' in where clause. It must use me.itemnumber like in Koha::Biblio->items Test plan : prove t/db_dependent/Biblio.t Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36317 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA QA Contact|testopia@bugs.koha-communit |m.de.rooy@rijksmuseum.nl |y.org | CC| |m.de.rooy@rijksmuseum.nl --- Comment #4 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Biblio.t passes with and without this patch. Please extend the test to show that this patch resolves the issue. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36317 --- Comment #5 from Fridolin Somers <fridolin.somers@biblibre.com> --- Ah mistake, it is t/db_dependent/Koha/Biblio.t I'm on adding a UT -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36317 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36317 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #163155|0 |1 is obsolete| | --- Comment #6 from Fridolin Somers <fridolin.somers@biblibre.com> --- Created attachment 163334 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=163334&action=edit Bug 36317: Add unit test If fails it shows : DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st execute failed: Column 'itemnumber' in where clause is ambiguous at /kohadevbox/koha/Koha/Objects.pm line 399 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36317 --- Comment #7 from Fridolin Somers <fridolin.somers@biblibre.com> --- Created attachment 163335 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=163335&action=edit Bug 36317: Koha::Biblio->host_items must use me.itemnumber Koha::Biblio->host_items fails with search_ordered() because of ambiguous column 'itemnumber' in where clause. It must use me.itemnumber like in Koha::Biblio->items Test plan : prove t/db_dependent/Biblio.t Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36317 --- Comment #8 from Fridolin Somers <fridolin.somers@biblibre.com> --- (In reply to Fridolin Somers from comment #6)
Created attachment 163334 [details] [review] Bug 36317: Add unit test
If fails it shows : DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st execute failed: Column 'itemnumber' in where clause is ambiguous at /kohadevbox/koha/Koha/Objects.pm line 399
Combining Koha::Biblio->host_items with Koha::Items->search_ordered in test suite was too hard. I've done a simpler join on an item transfer which fails on current master. Note that I test with MariaDB 10.6. Looks like it is more severe on join than lower versions. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36317 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #163335|0 |1 is obsolete| | --- Comment #9 from Fridolin Somers <fridolin.somers@biblibre.com> --- Created attachment 163338 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=163338&action=edit Bug 36317: Koha::Biblio->host_items must use me.itemnumber Koha::Biblio->host_items fails with search_ordered() because of ambiguous column 'itemnumber' in where clause. It must use me.itemnumber like in Koha::Biblio->items Test plan : prove t/db_dependent/Koha/Biblio.t Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36317 --- Comment #10 from Fridolin Somers <fridolin.somers@biblibre.com> --- Working on this I learned that DBIx combines several searches into one : Koha::Items->search( { itemnumber => 123 } )->search( {}, { join => 'branchtransfers' } ); Will give only one SQL query : SELECT * FROM items JOIN branchtransfers USING itemnumber WHERE itemnumber='123' So we should always use explicit "me" : Koha::Items->search( { "me.itemnumber" => 123 } )->search( {}, { join => 'branchtransfers' } ); -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36317 Emmi Takkinen <emmi.takkinen@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #163334|0 |1 is obsolete| | CC| |emmi.takkinen@koha-suomi.fi --- Comment #11 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- Created attachment 164238 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=164238&action=edit Bug 36317: Add unit test If fails it shows : DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st execute failed: Column 'itemnumber' in where clause is ambiguous at /kohadevbox/koha/Koha/Objects.pm line 399 Signed-off-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36317 --- Comment #12 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- Created attachment 164239 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=164239&action=edit Bug 36317: Koha::Biblio->host_items must use me.itemnumber Koha::Biblio->host_items fails with search_ordered() because of ambiguous column 'itemnumber' in where clause. It must use me.itemnumber like in Koha::Biblio->items Test plan : prove t/db_dependent/Koha/Biblio.t Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36317 Emmi Takkinen <emmi.takkinen@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #163338|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36317 Emmi Takkinen <emmi.takkinen@koha-suomi.fi> 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=36317 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |nick@bywatersolutions.com --- Comment #13 from Nick Clemens <nick@bywatersolutions.com> --- How is this failure encountered? Or is this the base for another bug? 1 - Enable EasyAnalyticalRecords 2 - Go to a records details page and copy a barcode 3 - Go to another record 4 - Edit -> Link to host record 5 - Enter the barcode 6 - Records are now linked, and display with no error -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36317 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36317 --- Comment #14 from Fridolin Somers <fridolin.somers@biblibre.com> --- (In reply to Nick Clemens from comment #13)
How is this failure encountered? Or is this the base for another bug?
1 - Enable EasyAnalyticalRecords 2 - Go to a records details page and copy a barcode 3 - Go to another record 4 - Edit -> Link to host record 5 - Enter the barcode 6 - Records are now linked, and display with no error
Currently there is no failure but there is a good chance in the future. For example Bug 24192 wants to add : $dat->{ITEM_RESULTS} = $biblio->host_items->search_ordered; -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36317 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Signed Off --- Comment #15 from Fridolin Somers <fridolin.somers@biblibre.com> --- Could QA have another look please ? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36317 Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #164238|0 |1 is obsolete| | --- Comment #16 from Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> --- Created attachment 173432 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=173432&action=edit Bug 36317: Add unit test If fails it shows : DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st execute failed: Column 'itemnumber' in where clause is ambiguous at /kohadevbox/koha/Koha/Objects.pm line 399 Signed-off-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36317 Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #164239|0 |1 is obsolete| | --- Comment #17 from Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> --- Created attachment 173433 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=173433&action=edit Bug 36317: Koha::Biblio->host_items must use me.itemnumber Koha::Biblio->host_items fails with search_ordered() because of ambiguous column 'itemnumber' in where clause. It must use me.itemnumber like in Koha::Biblio->items Test plan : prove t/db_dependent/Koha/Biblio.t Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36317 Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA QA Contact|m.de.rooy@rijksmuseum.nl |martin.renvoize@ptfs-europe | |.com CC| |martin.renvoize@ptfs-europe | |.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36317 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |24.11.00 released in| | Status|Passed QA |Pushed to main -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36317 --- Comment #18 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Pushed for 24.11! Well done everyone, thank you! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36317 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lucas@bywatersolutions.com Status|Pushed to main |Pushed to stable Version(s)|24.11.00 |24.11.00,24.05.06 released in| | --- Comment #19 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Backported to 24.05.x for upcoming 24.05.06 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36317 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to stable |Pushed to oldstable -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36317 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to oldstable |Pushed to oldoldstable Version(s)|24.11.00,24.05.06 |24.11.00,24.05.06,23.11.11 released in| | --- Comment #20 from Fridolin Somers <fridolin.somers@biblibre.com> --- Pushed to 23.11.x for 23.11.11 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36317 Jesse Maseto <jesse@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jesse@bywatersolutions.com Status|Pushed to oldoldstable |RESOLVED Resolution|--- |FIXED --- Comment #21 from Jesse Maseto <jesse@bywatersolutions.com> --- Not pushed to LTS. Marked Resolved. If you feel this should be in LTS please reply with your reason. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org