Bug 41063 - Additional fields are broken in Vue (values entered are not saved)
Summary: Additional fields are broken in Vue (values entered are not saved)
Status: Pushed to main
Alias: None
Product: Koha
Classification: Unclassified
Component: ERM (show other bugs)
Version: Main
Hardware: All All
: P5 - low major
Assignee: Matt Blenkinsop
QA Contact: Martin Renvoize (ashimema)
URL:
Keywords:
Depends on: 38201
Blocks: 38262
  Show dependency treegraph
 
Reported: 2025-10-21 12:15 UTC by Matt Blenkinsop
Modified: 2025-10-31 21:31 UTC (History)
8 users (show)

See Also:
GIT URL:
Initiative type: ---
Sponsorship status: ---
Comma delimited list of Sponsors:
Crowdfunding goal: 0
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
This fixes the saving of data for additional fields for modules in Koha that use Vue (ERM, Preservation, Acquisitions). The data entered for additional fields is now saved, instead of being ignored and lost. For example, data for additional fields added to ERM agreements was not being saved, but now are.
Version(s) released in:
25.11.00
Circulation function:


Attachments
Bug 41063: Fix additional fields in Vue (3.65 KB, patch)
2025-10-21 12:18 UTC, Matt Blenkinsop
Details | Diff | Splinter Review
Bug 41063: Allow setting of a group for additional fields (1.87 KB, patch)
2025-10-21 13:10 UTC, Matt Blenkinsop
Details | Diff | Splinter Review
Bug 41063: Allow setting of a group for additional fields (2.93 KB, patch)
2025-10-21 15:06 UTC, Matt Blenkinsop
Details | Diff | Splinter Review
Bug 41063: Allow setting of a group for additional fields (2.21 KB, patch)
2025-10-23 14:01 UTC, Matt Blenkinsop
Details | Diff | Splinter Review
Bug 41063: Fix additional fields in Vue (3.70 KB, patch)
2025-10-23 18:25 UTC, David Nind
Details | Diff | Splinter Review
Bug 41063: Allow setting of a group for additional fields (2.26 KB, patch)
2025-10-23 18:25 UTC, David Nind
Details | Diff | Splinter Review
Bug 41063: Fix additional fields in Vue (4.25 KB, patch)
2025-10-31 07:32 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 41063: Allow setting of a group for additional fields (2.73 KB, patch)
2025-10-31 07:32 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Matt Blenkinsop 2025-10-21 12:15:24 UTC
To reproduce:
1) Go to Administration > Additional fields and add an additional field for erm_agreements
2) Enable ERM and navigate to ERM > Agreements
3) Click to add a new agreement and then fill out the form, making sure to add something into your new additional field
4) Hit save and navigate to the agreement you have just added
5) There will be no additional field added
Comment 1 Matt Blenkinsop 2025-10-21 12:18:07 UTC
Created attachment 188212 [details] [review]
Bug 41063: Fix additional fields in Vue

Test plan:
1) Go to Administration > Additional fields and add an additional field for erm_agreements
2) Enable ERM and navigate to ERM > Agreements
3) Click to add a new agreement and then fill out the form, making sure to add something into your new additional field
4) Hit save and navigate to the agreement you have just added
5) There will be no additional field added
6) Apply patch and yarn js:build
7) Repeat steps 3 - 5
8) The additional field should be added and displayed correctly
Comment 2 Matt Blenkinsop 2025-10-21 13:10:13 UTC
Created attachment 188216 [details] [review]
Bug 41063: Allow setting of a group for additional fields
Comment 3 Matt Blenkinsop 2025-10-21 15:06:43 UTC
Created attachment 188228 [details] [review]
Bug 41063: Allow setting of a group for additional fields
Comment 4 Matt Blenkinsop 2025-10-23 14:01:10 UTC
Created attachment 188363 [details] [review]
Bug 41063: Allow setting of a group for additional fields
Comment 5 David Nind 2025-10-23 18:25:48 UTC
Created attachment 188389 [details] [review]
Bug 41063: Fix additional fields in Vue

Test plan:
1) Go to Administration > Additional fields and add an additional field for erm_agreements
2) Enable ERM and navigate to ERM > Agreements
3) Click to add a new agreement and then fill out the form, making sure to add something into your new additional field
4) Hit save and navigate to the agreement you have just added
5) There will be no additional field added
6) Apply patch and yarn js:build
7) Repeat steps 3 - 5
8) The additional field should be added and displayed correctly

Signed-off-by: David Nind <david@davidnind.com>
Comment 6 David Nind 2025-10-23 18:25:52 UTC
Created attachment 188390 [details] [review]
Bug 41063: Allow setting of a group for additional fields

Signed-off-by: David Nind <david@davidnind.com>
Comment 7 David Nind 2025-10-23 18:32:57 UTC
I changed the status to major (from enhancement) and added a release note.
Comment 8 Aleisha Amohia 2025-10-28 21:12:19 UTC
I followed the test plan and tried restarting services, but my additional field never showed up and wasn't saved in my agreement.
Comment 9 Matt Blenkinsop 2025-10-29 09:22:05 UTC
It still works for me when applying on main - you might need a hard refresh of the browser to rule out caching of the pre-existing javascript if you didn't try that?
Comment 10 Martin Renvoize (ashimema) 2025-10-31 07:32:11 UTC
Created attachment 188752 [details] [review]
Bug 41063: Fix additional fields in Vue

Additional fields added through Vue.js resource forms were not being
saved to the database. This was caused by using ref() instead of
reactive() for the current_additional_fields_values object. Since
ref() only provides shallow reactivity for objects, changes to nested
properties were not being tracked properly.

This switches to reactive() which provides deep reactivity tracking,
ensuring that all changes to additional field values are properly
captured and submitted when the form is saved.

Test plan:
1) Go to Administration > Additional fields and add an additional field
   for erm_agreements
2) Enable ERM and navigate to ERM > Agreements
3) Click to add a new agreement and then fill out the form, making sure
   to add something into your new additional field
4) Hit save and navigate to the agreement you have just added
5) There will be no additional field added
6) Apply patch and yarn js:build
7) Repeat steps 3 - 5
8) The additional field should be added and displayed correctly

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Comment 11 Martin Renvoize (ashimema) 2025-10-31 07:32:13 UTC
Created attachment 188753 [details] [review]
Bug 41063: Allow setting of a group for additional fields

Adds support for the extendedAttributesFieldGroup configuration option
in base-resource.js composable. This allows developers to specify which
form section/group additional fields should appear in, providing better
control over form organization and UX.

Without this, additional fields always appeared in the default group,
making it difficult to logically organize complex forms with multiple
field groupings.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Comment 12 Martin Renvoize (ashimema) 2025-10-31 07:32:43 UTC
I tested with all additional field types available and all worked as expected for me.. I couldn't replicate Aliesha's issues.

Passing QA
Comment 13 Lucas Gass (lukeg) 2025-10-31 21:31:33 UTC
Nice work everyone!

Pushed to main for 25.11