Bug 39346

Summary: Only 20 additional fields can be added to an agreement
Product: Koha Reporter: Mathieu Saby <mathsabypro>
Component: ERMAssignee: Jonathan Druart <jonathan.druart>
Status: Pushed to main --- QA Contact: Matt Blenkinsop <matt.blenkinsop>
Severity: normal    
Priority: P5 - low CC: david, jonathan.druart, jonathan.field, martin.renvoize, matt.blenkinsop, pedro.amorim
Version: Main   
Hardware: All   
OS: All   
GIT URL: Change sponsored?: ---
Patch complexity: --- Documentation contact:
Documentation submission: Text to go in the release notes:
This fixes adding a new agreement in the ERM module, where there are more than 20 additional fields. All additional fields are now listed, not just the first 20.
Version(s) released in:
25.05.00
Circulation function:
Bug Depends on: 35287    
Bug Blocks:    
Attachments: [24.11] Bug 39346: Display all additional fields
Bug 39346: Display all additional fields
Bug 39346: Display all additional fields
Bug 39346: Display all additional fields

Description Mathieu Saby 2025-03-16 12:16:49 UTC
In administration, create 25 supplementary fields for ERM Agreements
In ERM module, create an agreement : only 20 of the supplementary fields will be displayed

It must be an issue with API call?
Maybe it affects also other parts of Koha? If so it should be fixed everywhere
Comment 1 Katrin Fischer 2025-03-16 12:57:50 UTC
We use "additional fields" as the English term in the staff interface, just trying to make this stand out a bit more in result lists.
Comment 2 Katrin Fischer 2025-03-16 12:59:22 UTC
As a workaround, you can try to change  RESTdefaultPageSize to a higher value and see if that fixes the issue temporarily.
Comment 3 Mathieu Saby 2025-03-16 14:50:59 UTC
I am just testing the module, no rush for a fix...
Comment 4 Jonathan Druart 2025-03-17 10:48:09 UTC
Created attachment 179384 [details] [review]
[24.11] Bug 39346: Display all additional fields

getAll should call getAll, not get, or we lose the _per_page=-1
parameter.

Test plan:
Have more than 20 additional fields for agreements
Create and agreement:
=> Notice that with this patch, all the fields are displayed.
Comment 5 David Nind 2025-03-18 03:28:20 UTC
The patch no longer applies 8-(...

git bz apply 39346

Bug 39346 - Only 20 additional fields can be added to an agreement

179384 - Bug 39346: Display all additional fields

Apply? [(y)es, (n)o, (i)nteractive] y
Applying: Bug 39346: Display all additional fields
Using index info to reconstruct a base tree...
A	koha-tmpl/intranet-tmpl/prog/js/vue/fetch/additional-fields-api-client.js
Falling back to patching base and 3-way merge...
Auto-merging koha-tmpl/intranet-tmpl/prog/js/fetch/additional-fields-api-client.js
CONFLICT (content): Merge conflict in koha-tmpl/intranet-tmpl/prog/js/fetch/additional-fields-api-client.js
error: Failed to merge in the changes.
Patch failed at 0001 Bug 39346: Display all additional fields

Testing notes (using KTD):
1. The workaround suggested in comment #2 does work: change RESTdefaultPageSize to a higher value.
2. To add additional fields:
   - Go to: Koha administration > Additional parameters > Additional fields > E-resource management > Agreements (erm_agreements)
Comment 6 Jonathan Druart 2025-03-18 08:31:01 UTC
Created attachment 179420 [details] [review]
Bug 39346: Display all additional fields

getAll should call getAll, not get, or we lose the _per_page=-1
parameter.

Test plan:
Have more than 20 additional fields for agreements
Create and agreement:
=> Notice that with this patch, all the fields are displayed.
Comment 7 David Nind 2025-03-18 09:54:16 UTC
Created attachment 179424 [details] [review]
Bug 39346: Display all additional fields

getAll should call getAll, not get, or we lose the _per_page=-1
parameter.

Test plan:
Have more than 20 additional fields for agreements
Create and agreement:
=> Notice that with this patch, all the fields are displayed.

Signed-off-by: David Nind <david@davidnind.com>
Comment 8 David Nind 2025-03-18 09:55:30 UTC
Updated testing notes (using KTD):
1. The workaround suggested in comment #2 does work: change RESTdefaultPageSize to a higher value.
2. To add additional fields:
   - Go to: Koha administration > Additional parameters > Additional fields > E-resource management > Agreements (erm_agreements)
3. After applying the patch:
   - yarn build
   - restart_all
   - clear your browser cache
Comment 9 Matt Blenkinsop 2025-04-03 08:33:33 UTC
Created attachment 180445 [details] [review]
Bug 39346: Display all additional fields

getAll should call getAll, not get, or we lose the _per_page=-1
parameter.

Test plan:
Have more than 20 additional fields for agreements
Create and agreement:
=> Notice that with this patch, all the fields are displayed.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk>
Comment 10 Katrin Fischer 2025-04-10 17:27:59 UTC
Pushed for 25.05!

Well done everyone, thank you!