Bug 25942

Summary: Batch biblio and borrower operations on report results should not concatenate biblio/cardnumbers into a single string
Product: Koha Reporter: Nick Clemens <nick>
Component: ReportsAssignee: Nick Clemens <nick>
Status: RESOLVED FIXED QA Contact: Testopia <testopia>
Severity: major    
Priority: P5 - low CC: andrew, jonathan.druart, kelly, marjorie.barry-vila, mfuerst, oleonard, victor
Version: masterKeywords: rel_21_05_candidate
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Text to go in the release notes:
Version(s) released in:
20.11.00, 20.05.07
Bug Depends on: 24886    
Bug Blocks: 27142    
Attachments: Bug 25942: Fix batch report operations for cardnumbers and biblionumbers
Bug 25942: Fix batch report operations for cardnumbers and biblionumbers
Bug 25942: Fix batch report operations for cardnumbers and biblionumbers
Bug 25942: (follow-up) fix filters
Bug 25942: Fix batch report operations for cardnumbers and biblionumbers
Bug 25942: (follow-up) fix filters
Bug 25942: Fix batch report operations for cardnumbers and biblionumbers

Description Nick Clemens 2020-07-07 00:16:21 UTC
Bug 24886 cleaned up the templates and removed a new line in the recordnumber_list textarea loop

Now if one tries to send biblionumbers from a report to batch operations they are all sent as a single string
Comment 1 Andrew Fuerste-Henry 2020-11-16 20:43:46 UTC
Cardnumbers do the same.
Itemnumbers do not.
Comment 2 Andrew Fuerste-Henry 2020-11-16 20:50:43 UTC
This bug completely breaks a relatively new and rather popular feature. It'd be great to see it fixed sooner rather than later.
Comment 3 Kelly McElligott 2020-11-18 12:23:58 UTC
+1
Comment 4 Nick Clemens 2020-11-18 13:34:28 UTC
Created attachment 113782 [details] [review]
Bug 25942: Fix batch report operations for cardnumbers and biblionumbers

This patch moves the processing for these to a block and adds a comment
in place of whitespace and uses template directives to chomp newlines to improve readability

To test:
 1 - Create a report like:
    SELECT biblionumber FROM biblios
 2 - Run it
 3 - Try the various options from the 'Batch operations' button
    (You will need to define a marc modification template)
 4 - The operations don't find the biblios
 5 - Create a report like:
    SELECT cardnumber FROM borrowers
 6 - Run it
 7 - Test the batch operations
 8 - They fail
 9 - Apply patch
10 - Run each report again and test batch operations
11 - They work!
Comment 5 Andrew Fuerste-Henry 2020-11-18 13:44:35 UTC
Created attachment 113783 [details] [review]
Bug 25942: Fix batch report operations for cardnumbers and biblionumbers

This patch moves the processing for these to a block and adds a comment
in place of whitespace and uses template directives to chomp newlines to improve readability

To test:
 1 - Create a report like:
    SELECT biblionumber FROM biblios
 2 - Run it
 3 - Try the various options from the 'Batch operations' button
    (You will need to define a marc modification template)
 4 - The operations don't find the biblios
 5 - Create a report like:
    SELECT cardnumber FROM borrowers
 6 - Run it
 7 - Test the batch operations
 8 - They fail
 9 - Apply patch
10 - Run each report again and test batch operations
11 - They work!

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Comment 6 Victor Grousset/tuxayo 2020-11-22 12:51:00 UTC
Created attachment 113916 [details] [review]
Bug 25942: Fix batch report operations for cardnumbers and biblionumbers

This patch moves the processing for these to a block and adds a comment
in place of whitespace and uses template directives to chomp newlines to improve readability

To test:
 1 - Create a report like:
    SELECT biblionumber FROM biblio
 2 - Run it
 3 - Try the various options from the 'Batch operations' button
    (You will need to define a marc modification template)
 4 - The operations don't find the biblios
 5 - Create a report like:
    SELECT cardnumber FROM borrowers
 6 - Run it
 7 - Test the batch operations
 8 - They fail
 9 - Apply patch
10 - Run each report again and test batch operations
11 - They work!

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Comment 7 Victor Grousset/tuxayo 2020-11-22 12:52:38 UTC
As a step towards QA, here is another signoff.

However, the QA script reports this:

 FAIL	koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt
   FAIL	  filters
		missing_filter at line 873 (                                    [%- recordnumbers = PROCESS batch_list results=results batch_type='biblionumber' | trim %][% IF recordnumbers %][% SET batch_biblionumbers = 1 %][% recordnumbers %][% END -%])
		missing_filter at line 873 (                                    [%- recordnumbers = PROCESS batch_list results=results batch_type='biblionumber' | trim %][% IF recordnumbers %][% SET batch_biblionumbers = 1 %][% recordnumbers %][% END -%])
		missing_filter at line 882 (                                    [%- recordnumbers = PROCESS batch_list results=results batch_type='biblionumber' | trim %][% IF recordnumbers %][% SET batch_biblionumbers = 1 %][% recordnumbers %][% END -%])
		missing_filter at line 882 (                                    [%- recordnumbers = PROCESS batch_list results=results batch_type='biblionumber' | trim %][% IF recordnumbers %][% SET batch_biblionumbers = 1 %][% recordnumbers %][% END -%])
		missing_filter at line 935 (                                    [%- cardnumbers = PROCESS batch_list results=results batch_type='cardnumber' | trim %][% IF cardnumbers %][% SET batch_cardnumbers = 1 %][% cardnumbers %][% END -%])
		missing_filter at line 935 (                                    [%- cardnumbers = PROCESS batch_list results=results batch_type='cardnumber' | trim %][% IF cardnumbers %][% SET batch_cardnumbers = 1 %][% cardnumbers %][% END -%])
Comment 8 Nick Clemens 2020-11-23 13:32:51 UTC
Created attachment 113924 [details] [review]
Bug 25942: (follow-up) fix filters
Comment 9 Victor Grousset/tuxayo 2020-11-23 17:50:21 UTC
Created attachment 113931 [details] [review]
Bug 25942: Fix batch report operations for cardnumbers and biblionumbers

This patch moves the processing for these to a block and adds a comment
in place of whitespace and uses template directives to chomp newlines to improve readability

To test:
 1 - Create a report like:
    SELECT biblionumber FROM biblio
 2 - Run it
 3 - Try the various options from the 'Batch operations' button
    (You will need to define a marc modification template)
 4 - The operations don't find the biblios
 5 - Create a report like:
    SELECT cardnumber FROM borrowers
 6 - Run it
 7 - Test the batch operations
 8 - They fail
 9 - Apply patch
10 - Run each report again and test batch operations
11 - They work!

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Comment 10 Victor Grousset/tuxayo 2020-11-23 17:50:25 UTC
Created attachment 113932 [details] [review]
Bug 25942: (follow-up) fix filters

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Comment 11 Victor Grousset/tuxayo 2020-11-23 17:50:48 UTC
Thanks, QA script ok :)
Comment 12 Victor Grousset/tuxayo 2020-11-23 17:50:59 UTC
(and it works ^^)
Comment 13 Jonathan Druart 2020-11-25 10:57:31 UTC
Created attachment 113972 [details] [review]
Bug 25942: Fix batch report operations for cardnumbers and biblionumbers

This patch moves the processing for these to a block and adds a comment
in place of whitespace and uses template directives to chomp newlines to improve readability

To test:
 1 - Create a report like:
    SELECT biblionumber FROM biblio
 2 - Run it
 3 - Try the various options from the 'Batch operations' button
    (You will need to define a marc modification template)
 4 - The operations don't find the biblios
 5 - Create a report like:
    SELECT cardnumber FROM borrowers
 6 - Run it
 7 - Test the batch operations
 8 - They fail
 9 - Apply patch
10 - Run each report again and test batch operations
11 - They work!

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>

Bug 25942: (follow-up) fix filters

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 14 Jonathan Druart 2020-11-25 15:19:48 UTC
Pushed to master for 20.11, thanks to everybody involved!
Comment 15 Owen Leonard 2020-12-03 12:58:24 UTC
This doesn't seem to have correctly addressed batch patron modifications: Bug 27142
Comment 16 Martha Fuerst 2020-12-07 19:47:39 UTC
Any chance at a backport to 20.05?
Comment 17 Andrew Fuerste-Henry 2020-12-10 21:20:54 UTC
backported to 20.05.x for 20.05.07
Comment 18 Victor Grousset/tuxayo 2020-12-11 14:56:26 UTC
Missing dependencies for 19.11.x, no backport.
19.11.x shouldn't be affected.