Bug 22431 - Incorrect group by in circ/pendingreserves.pl
Summary: Incorrect group by in circ/pendingreserves.pl
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Circulation (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
: 23175 (view as bug list)
Depends on: 13640
Blocks: 17258
  Show dependency treegraph
 
Reported: 2019-02-28 11:35 UTC by Nick Clemens
Modified: 2019-08-21 13:51 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Clemens 2019-02-28 11:35:19 UTC
This one seems tricky as we are probably doing some bad things here - we get the reserves, group by biblionumber, then do a mix of taking all values from a field and trying to get the values for the 'first' patron.

I think this one needs to be two queries joined which may impact peformance but should be much more correct
Comment 1 Katrin Fischer 2019-04-04 07:33:10 UTC
Hi Nick, can you add how the bug manifests? What is the wrong behaivour?
Comment 2 Nick Clemens 2019-04-04 11:50:21 UTC
Enable strict mode
Have some holds to pull
Browse to  Circulation -> Holds to pull
Internal Server Error

The report cannot run in strict mode due to using columns not included in GROUP BY
Comment 3 Jonathan Druart 2019-06-19 18:00:44 UTC
I have a "PFFF rewriting pendingreserves.pl" commit on a local branch, if anyone is willing to work on/continue it.
Comment 4 Martin Renvoize 2019-06-21 09:21:23 UTC
*** Bug 23175 has been marked as a duplicate of this bug. ***
Comment 5 Martin Renvoize 2019-06-21 09:22:50 UTC
(In reply to Jonathan Druart from comment #3)
> I have a "PFFF rewriting pendingreserves.pl" commit on a local branch, if
> anyone is willing to work on/continue it.

I'm game for looking at this.
Comment 6 Jonathan Druart 2019-06-22 20:57:29 UTC
(In reply to Martin Renvoize from comment #5)
> (In reply to Jonathan Druart from comment #3)
> > I have a "PFFF rewriting pendingreserves.pl" commit on a local branch, if
> > anyone is willing to work on/continue it.
> 
> I'm game for looking at this.

https://gitlab.com/joubu/Koha/commits/bug_22431
That's super dirty and I am not really sure what I was trying to achieve.
IIRC the problem was the GROUP_CONCAT clause. So creating relevant data, executing the query, then comparing with what would replace the query (using Koha::Holds). That's really a work in progress but... not finished :)
Good luck!