Bug 34519

Summary: Add a template plugin for ExtendedAttributeTypes to fetch searchable patron attributes
Product: Koha Reporter: Nick Clemens (kidclamp) <nick>
Component: TemplatesAssignee: Nick Clemens (kidclamp) <nick>
Status: RESOLVED FIXED QA Contact: Katrin Fischer <katrin.fischer>
Severity: enhancement    
Priority: P5 - low CC: fridolin.somers, januszop
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36025
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
23.11.00
Bug Depends on: 33428    
Bug Blocks: 26916    
Attachments: Bug 34519: Add a template plugin for fetch searchable patron attributes
Bug 34519: Unit tests
Bug 34519: Ensure we always have an array
Bug 34519: Ensure we always have an array
Bug 34519: Add a template plugin for fetch searchable patron attributes
Bug 34519: Unit tests
Bug 34519: Ensure we always have an array
Bug 34519: (follow-up) fix QA tool complaints
Bug 34519: Add a template plugin for fetch searchable patron attributes
Bug 34519: Unit tests
Bug 34519: Ensure we always have an array
Bug 34519: (follow-up) fix QA tool complaints
Bug 34519: Add a template plugin for fetch searchable patron attributes
Bug 34519: Unit tests
Bug 34519: Ensure we always have an array
Bug 34519: (follow-up) fix QA tool complaints

Description Nick Clemens (kidclamp) 2023-08-11 14:15:43 UTC
Currently we fetch the searchable attributes in several scripts

Moving to a plugin allows us to make a single call from the patron search template
Comment 1 Nick Clemens (kidclamp) 2023-08-11 14:37:50 UTC
Created attachment 154375 [details] [review]
Bug 34519: Add a template plugin for fetch searchable patron attributes

This patch moves code form scripts to a template plguin and unifies the calls

To test:
1 - Add a searchable patron attribute type
2 - Add values to several patrons and test patron searching from
    Patrons home
    Patrons search results
    Holds request screen
    Article request screen
    Patron search sidebar
3 - Apply patch
4 - Confirm results are the same
Comment 2 Nick Clemens (kidclamp) 2023-08-11 14:37:52 UTC
Created attachment 154376 [details] [review]
Bug 34519: Unit tests
Comment 3 Nick Clemens (kidclamp) 2023-08-11 16:43:32 UTC
Created attachment 154384 [details] [review]
Bug 34519: Ensure we always have an array
Comment 4 Janusz Kaczmarek 2023-08-18 11:04:24 UTC
There are no results when searching with patron extended attribute from:
- Holds request screen, and 
- Article request screen.
Comment 5 Nick Clemens (kidclamp) 2023-08-18 11:20:07 UTC
Follow-up added to 33428 which should restore the attribute searching on the other screens
Comment 6 Janusz Kaczmarek 2023-08-18 11:30:23 UTC
Created attachment 154641 [details] [review]
Bug 34519: Ensure we always have an array

Signed-off-by: Janusz Kaczmarek <januszop@gmail.com>
Comment 7 Janusz Kaczmarek 2023-08-18 12:13:34 UTC
Created attachment 154646 [details] [review]
Bug 34519: Add a template plugin for fetch searchable patron attributes

This patch moves code form scripts to a template plguin and unifies the calls

To test:
1 - Add a searchable patron attribute type
2 - Add values to several patrons and test patron searching from
    Patrons home
    Patrons search results
    Holds request screen
    Article request screen
    Patron search sidebar
3 - Apply patch
4 - Confirm results are the same

Signed-off-by: Janusz Kaczmarek <januszop@gmail.com>
Comment 8 Janusz Kaczmarek 2023-08-18 12:13:37 UTC
Created attachment 154647 [details] [review]
Bug 34519: Unit tests

Signed-off-by: Janusz Kaczmarek <januszop@gmail.com>
Comment 9 Janusz Kaczmarek 2023-08-18 12:13:39 UTC
Created attachment 154648 [details] [review]
Bug 34519: Ensure we always have an array

Signed-off-by: Janusz Kaczmarek <januszop@gmail.com>
Comment 10 Nick Clemens (kidclamp) 2023-08-18 12:17:22 UTC
Created attachment 154649 [details] [review]
Bug 34519: (follow-up) fix QA tool complaints
Comment 11 Katrin Fischer 2023-10-21 08:46:43 UTC
Hi Nick, can you please rebase?

Apply? [(y)es, (n)o, (i)nteractive] y
Applying: Bug 34519: Add a template plugin for fetch searchable patron attributes
error: sha1 information is lacking or useless (koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc).
error: could not build fake ancestor
Patch failed at 0001 Bug 34519: Add a template plugin for fetch searchable patron attributes
hint: Use 'git am --show-current-patch=diff' to see the failed patch
When you have resolved this problem run "git bz apply --continue".
If you would prefer to skip this patch, instead run "git bz apply --skip".
To restore the original branch and stop patching run "git bz apply --abort".
Patch left in /tmp/Bug-34519-Add-a-template-plugin-for-fetch-searchab-vtceflb2.patch
Comment 12 Nick Clemens (kidclamp) 2023-10-23 13:22:21 UTC
Created attachment 157649 [details] [review]
Bug 34519: Add a template plugin for fetch searchable patron attributes

This patch moves code form scripts to a template plguin and unifies the calls

To test:
1 - Add a searchable patron attribute type
2 - Add values to several patrons and test patron searching from
    Patrons home
    Patrons search results
    Holds request screen
    Article request screen
    Patron search sidebar
3 - Apply patch
4 - Confirm results are the same

Signed-off-by: Janusz Kaczmarek <januszop@gmail.com>
Comment 13 Nick Clemens (kidclamp) 2023-10-23 13:22:23 UTC
Created attachment 157650 [details] [review]
Bug 34519: Unit tests

Signed-off-by: Janusz Kaczmarek <januszop@gmail.com>
Comment 14 Nick Clemens (kidclamp) 2023-10-23 13:22:25 UTC
Created attachment 157651 [details] [review]
Bug 34519: Ensure we always have an array

Signed-off-by: Janusz Kaczmarek <januszop@gmail.com>
Comment 15 Nick Clemens (kidclamp) 2023-10-23 13:22:27 UTC
Created attachment 157652 [details] [review]
Bug 34519: (follow-up) fix QA tool complaints
Comment 16 Katrin Fischer 2023-11-05 00:58:37 UTC
Created attachment 158423 [details] [review]
Bug 34519: Add a template plugin for fetch searchable patron attributes

This patch moves code form scripts to a template plguin and unifies the calls

To test:
1 - Add a searchable patron attribute type
2 - Add values to several patrons and test patron searching from
    Patrons home
    Patrons search results
    Holds request screen
    Article request screen
    Patron search sidebar
3 - Apply patch
4 - Confirm results are the same

Signed-off-by: Janusz Kaczmarek <januszop@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 17 Katrin Fischer 2023-11-05 00:58:40 UTC
Created attachment 158424 [details] [review]
Bug 34519: Unit tests

Signed-off-by: Janusz Kaczmarek <januszop@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 18 Katrin Fischer 2023-11-05 00:58:43 UTC
Created attachment 158425 [details] [review]
Bug 34519: Ensure we always have an array

Signed-off-by: Janusz Kaczmarek <januszop@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 19 Katrin Fischer 2023-11-05 00:58:45 UTC
Created attachment 158426 [details] [review]
Bug 34519: (follow-up) fix QA tool complaints

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 20 Tomás Cohen Arazi 2023-11-08 20:55:27 UTC
Pushed to master for 23.11.

Nice work everyone, thanks!
Comment 21 Fridolin Somers 2023-11-11 01:30:53 UTC
Depends on Bug 33428 not in 23.05.x