Bug 27127 - Wrong display of messages if there was only 1 record modified
Summary: Wrong display of messages if there was only 1 record modified
Status: Pushed to stable
Alias: None
Product: Koha
Classification: Unclassified
Component: Task Scheduler (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low normal (vote)
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords: rel_20_11_candidate
Depends on: 22417
Blocks: 27317
  Show dependency treegraph
 
Reported: 2020-12-01 14:34 UTC by Jonathan Druart
Modified: 2020-12-30 14:06 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Text to go in the release notes:
Version(s) released in:
21.05.00,20.11.01


Attachments
Bug 27127: Make Koha::BackgroundJob->messages return a scalar (1.10 KB, patch)
2020-12-01 14:40 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 27127: Make Koha::BackgroundJob->messages return a scalar (1.15 KB, patch)
2020-12-03 18:46 UTC, Lucas Gass
Details | Diff | Splinter Review
Bug 27127: Make Koha::BackgroundJob->messages return a scalar (1.21 KB, patch)
2020-12-17 19:33 UTC, Victor Grousset/tuxayo
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Druart 2020-12-01 14:34:59 UTC

    
Comment 1 Jonathan Druart 2020-12-01 14:40:45 UTC
Created attachment 114073 [details] [review]
Bug 27127: Make Koha::BackgroundJob->messages return a scalar

Otherwise the code in the template is not handled correctly:
112                     [% FOR m IN job.messages %]

m will become each key/val of the message hash:
{"type":"success","biblionumber":"1","code":"biblio_modified"}
And not the whole hash

Test plan:
Modify one biblio using the batch record modification tool
Modify two biblios using the batch record modification tool
Go to the detail view of each job and confirm that with this patch the
display is correct
Comment 2 Jonathan Druart 2020-12-01 14:45:27 UTC
Without this patch the display is: https://snipboard.io/JKRlkU.jpg
Comment 3 Lucas Gass 2020-12-03 18:46:20 UTC
Created attachment 114162 [details] [review]
Bug 27127: Make Koha::BackgroundJob->messages return a scalar

Otherwise the code in the template is not handled correctly:
112                     [% FOR m IN job.messages %]

m will become each key/val of the message hash:
{"type":"success","biblionumber":"1","code":"biblio_modified"}
And not the whole hash

Test plan:
Modify one biblio using the batch record modification tool
Modify two biblios using the batch record modification tool
Go to the detail view of each job and confirm that with this patch the
display is correct

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 4 Lucas Gass 2020-12-03 19:01:35 UTC
The display for modifying 1 record looks much better now :)
Comment 5 Victor Grousset/tuxayo 2020-12-17 19:33:29 UTC
Created attachment 114491 [details] [review]
Bug 27127: Make Koha::BackgroundJob->messages return a scalar

Otherwise the code in the template is not handled correctly:
112                     [% FOR m IN job.messages %]

m will become each key/val of the message hash:
{"type":"success","biblionumber":"1","code":"biblio_modified"}
And not the whole hash

Test plan:
Modify one biblio using the batch record modification tool
Modify two biblios using the batch record modification tool
Go to the detail view of each job and confirm that with this patch the
display is correct

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Comment 6 Victor Grousset/tuxayo 2020-12-17 19:34:30 UTC
all good :)
Comment 7 Jonathan Druart 2020-12-21 09:20:27 UTC
Pushed to master for 21.05, thanks to everybody involved!
Comment 8 Fridolin Somers 2020-12-28 13:52:00 UTC
Pushed to 20.11.x for 20.11.01
Comment 9 Andrew Fuerste-Henry 2020-12-28 15:31:11 UTC
Missing dependencies, not backported to 20.05