Bug 27142

Summary: Patron batch update from report module - no patrons loaded into view
Product: Koha Reporter: Stefan Norinder <somesecretemail>
Component: ReportsAssignee: Nick Clemens (kidclamp) <nick>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: major    
Priority: P5 - low CC: andrewfh, david, fridolin.somers, jonathan.druart, kelly, marjorie.barry-vila, martin.renvoize, nick, victor
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
This fixes an error when batch modifying patrons using the reports module. After running a report (such as SELECT * FROM borrowers LIMIT 50) and selecting batch modification an error was displayed: "Warning, the following cardnumbers were not found:", and you were not able to modify any patrons.
Version(s) released in:
21.05.00,20.11.01, 20.05.07
Bug Depends on: 24886, 25942    
Bug Blocks:    
Attachments: Bug 27142: Don't interpolate batch_type variable
Bug 27142: Don't interpolate batch_type variable
Bug 27142: Don't interpolate batch_type variable

Description Stefan Norinder 2020-12-03 06:10:41 UTC
Can't batch update patrons from reports module. 

Steps to reproduce: 

1. Navigate to reports module 
2. Create sql report with `select * from borrowers`
3. Save report 
4. Run report 
5. Click "Batch operation with 20 visible patrons" 
6. Click "Batch patron modification" 

Result: no patrons are loaded in the view. Koha shows message "Warning, the following cardnumbers were not found:" and presents all cardnumbers of patrons from the sql query. 

I verified that the same steps in Koha version 19.11 works fine.
Comment 1 Nick Clemens (kidclamp) 2020-12-03 13:34:29 UTC
Created attachment 114146 [details] [review]
Bug 27142: Don't interpolate batch_type variable

To test:
1 - Create a report like:
    SELECT * FROM borrowers LIMIT 50
2 - Run the report
3 - Attempt batch modification - it fails showing every row as an unfound cardnumber
4 - Apply patch
5 - Repeat
6 - Success!
7 - Edit report to:
    SELECT * FROM biblio LIMIT 50
8 - Repeat test
9 - Ensure batch modification and deletion work
Comment 2 David Nind 2020-12-03 21:20:14 UTC
Created attachment 114167 [details] [review]
Bug 27142: Don't interpolate batch_type variable

To test:
1 - Create a report like:
    SELECT * FROM borrowers LIMIT 50
2 - Run the report
3 - Attempt batch modification - it fails showing every row as an unfound cardnumber
4 - Apply patch
5 - Repeat
6 - Success!
7 - Edit report to:
    SELECT * FROM biblio LIMIT 50
8 - Repeat test
9 - Ensure batch modification and deletion work

Signed-off-by: David Nind <david@davidnind.com>
Comment 3 Martin Renvoize 2020-12-07 16:56:49 UTC
Created attachment 114238 [details] [review]
Bug 27142: Don't interpolate batch_type variable

To test:
1 - Create a report like:
    SELECT * FROM borrowers LIMIT 50
2 - Run the report
3 - Attempt batch modification - it fails showing every row as an unfound cardnumber
4 - Apply patch
5 - Repeat
6 - Success!
7 - Edit report to:
    SELECT * FROM biblio LIMIT 50
8 - Repeat test
9 - Ensure batch modification and deletion work

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 4 Martin Renvoize 2020-12-07 16:57:08 UTC
Works as expected, no regressions found. Passing QA
Comment 5 Jonathan Druart 2020-12-09 10:53:27 UTC
Pushed to master for 21.05, thanks to everybody involved!
Comment 6 Fridolin Somers 2020-12-10 10:28:28 UTC
Pushed to 20.11.x for 20.11.01
Comment 7 Andrew Fuerste-Henry 2020-12-10 21:22:21 UTC
Pushed to 20.05.x for 20.05.7
Comment 8 Jonathan Druart 2020-12-11 11:22:03 UTC
*** Bug 27194 has been marked as a duplicate of this bug. ***
Comment 9 Victor Grousset/tuxayo 2020-12-11 15:00:34 UTC
Missing dependencies for 19.11.x, can't backport.