Bug 39346 - Only 20 additional fields can be added to an agreement
Summary: Only 20 additional fields can be added to an agreement
Status: Pushed to main
Alias: None
Product: Koha
Classification: Unclassified
Component: ERM (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Jonathan Druart
QA Contact: Matt Blenkinsop
URL:
Keywords:
Depends on: 35287
Blocks:
  Show dependency treegraph
 
Reported: 2025-03-16 12:16 UTC by Mathieu Saby
Modified: 2025-04-10 17:27 UTC (History)
6 users (show)

See Also:
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:


Attachments
[24.11] Bug 39346: Display all additional fields (1.33 KB, patch)
2025-03-17 10:48 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 39346: Display all additional fields (1.32 KB, patch)
2025-03-18 08:31 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 39346: Display all additional fields (1.36 KB, patch)
2025-03-18 09:54 UTC, David Nind
Details | Diff | Splinter Review
Bug 39346: Display all additional fields (1.43 KB, patch)
2025-04-03 08:33 UTC, Matt Blenkinsop
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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!