Bug 28340

Summary: Provide improved display of ILL request metadata in notices
Product: Koha Reporter: Andrew Isherwood <bugzilla>
Component: ILLAssignee: Bugs List <koha-bugs>
Status: CLOSED FIXED QA Contact: Nick Clemens (kidclamp) <nick>
Severity: enhancement    
Priority: P5 - low CC: kyle, magnus, martin.renvoize, nick
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
21.11.00
Circulation function:
Attachments: Bug 28340: Alphabetise metadata for notices
Bug 28340: Alphabetise metadata for notices
Bug 28340: Unit test
Bug 28340: Alphabetise metadata for notices
Bug 28340: Unit test

Description Andrew Isherwood 2021-05-13 09:28:43 UTC
Currently ILL notices that contain a request's metadata just print the metadata in a random order. At the very least we should alphabetise the metadata by key.
Comment 1 Andrew Isherwood 2021-05-13 09:43:44 UTC
Created attachment 120914 [details] [review]
Bug 28340: Alphabetise metadata for notices

This commit sorts metadata by key prior to preparing a notice with it

Test plan:

- Do not apply patch
- Create a report with the following SQL:
  SELECT * FROM message_queue;
- Create an ILL request with plenty of metadata
- Go to "Manage request"
- Send a notice to a patron
- Run the report created earlier

=> TEST:
- Observe that the metadata is in random order

- Apply the patch
- Create an ILL request with plenty of metadata
- Go to "Manage request"
- Send a notice to a patron
- Run the report created earlier

=> TEST:
- Observe that the metadata is now sorted alphabetically by key
Comment 2 Martin Renvoize (ashimema) 2021-07-07 08:28:40 UTC
Created attachment 122631 [details] [review]
Bug 28340: Alphabetise metadata for notices

This commit sorts metadata by key prior to preparing a notice with it

Test plan:

- Do not apply patch
- Create a report with the following SQL:
  SELECT * FROM message_queue;
- Create an ILL request with plenty of metadata
- Go to "Manage request"
- Send a notice to a patron
- Run the report created earlier

=> TEST:
- Observe that the metadata is in random order

- Apply the patch
- Create an ILL request with plenty of metadata
- Go to "Manage request"
- Send a notice to a patron
- Run the report created earlier

=> TEST:
- Observe that the metadata is now sorted alphabetically by key

Signed-off-by: Jill Tivey <Jill.Tivey@sasa.gov.scot>
Comment 3 Martin Renvoize (ashimema) 2021-07-07 08:30:00 UTC
Attached signed off patch on behalf of Jill Tavey from Scottish Government.

She's tested this thoroughly and is happy to sign-off.. being ILL it's difficult to test with a sandbox so it was set up on a test system for her and she asked me to update bugzilla on her behalf.
Comment 4 Nick Clemens (kidclamp) 2021-07-30 17:33:47 UTC
Created attachment 123336 [details] [review]
Bug 28340: Unit test

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 5 Nick Clemens (kidclamp) 2021-07-30 17:33:50 UTC
Created attachment 123337 [details] [review]
Bug 28340: Alphabetise metadata for notices

This commit sorts metadata by key prior to preparing a notice with it

Test plan:

- Do not apply patch
- Create a report with the following SQL:
  SELECT * FROM message_queue;
- Create an ILL request with plenty of metadata
- Go to "Manage request"
- Send a notice to a patron
- Run the report created earlier

=> TEST:
- Observe that the metadata is in random order

- Apply the patch
- Create an ILL request with plenty of metadata
- Go to "Manage request"
- Send a notice to a patron
- Run the report created earlier

=> TEST:
- Observe that the metadata is now sorted alphabetically by key

Signed-off-by: Jill Tivey <Jill.Tivey@sasa.gov.scot>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 6 Jonathan Druart 2021-09-21 18:11:54 UTC
Created attachment 125120 [details] [review]
Bug 28340: Unit test

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

JD amended patch: remove commented line
Comment 7 Jonathan Druart 2021-09-21 18:18:50 UTC
Pushed to master for 21.11, thanks to everybody involved!