Bug 40192

Summary: Add additional fields to ERM titles
Product: Koha Reporter: Katrin Fischer <katrin.fischer>
Component: ERMAssignee: Matt Blenkinsop <matt.blenkinsop>
Status: Passed QA --- QA Contact: Martin Renvoize (ashimema) <martin.renvoize>
Severity: enhancement    
Priority: P5 - low CC: andrew.auld, clemens.tubach, jonathan.druart, jonathan.field, martin.renvoize, matt.blenkinsop, michaela.sieber, pedro.amorim
Version: Main   
Hardware: All   
OS: All   
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:
Version(s) released in:
Circulation function:
Bug Depends on: 38262, 40191    
Bug Blocks: 38911, 39438    
Attachments: Bug 40192: Add additional fields to ERM titles
Bug 40192: Add additional fields to ERM titles
Bug 40192: Add additional fields to ERM titles
Bug 40192: Add additional fields to ERM titles
Bug 40192: Add additional fields support to ERM titles
Bug 40192: Add additional fields support to ERM titles
Bug 40192: (bug 38446 follow-up) Add title to /erm/extended_attribute_types

Description Katrin Fischer 2025-06-20 09:23:46 UTC
It would be great if there was an option to add additional fields to ERM titles. 

One use case would be adding mappings for KBART files as suggested by bug 38911.

KBART files from GoKB and other knowledge bases use the COUNTER "feature" of providing additional information and important identifiers as additional columns in KBART. Storing them in Koha would be very beneficial. But additional fields could also be used for a lot of others useful things.
Comment 1 Matt Blenkinsop 2025-10-21 10:27:02 UTC
Created attachment 188211 [details] [review]
Bug 40192: Add additional fields to ERM titles
Comment 2 Michaela Sieber 2025-10-21 11:35:32 UTC
does not work, neither in sandboxes, nor in ktd
Comment 3 Matt Blenkinsop 2025-10-23 15:15:36 UTC
Created attachment 188371 [details] [review]
Bug 40192: Add additional fields to ERM titles
Comment 4 Biblibre Sandboxes 2025-10-23 15:49:48 UTC
Created attachment 188374 [details] [review]
Bug 40192: Add additional fields to ERM titles

Signed-off-by: Michaela <michaela.sieber@kit.edu>
Comment 5 Matt Blenkinsop 2025-10-23 16:33:39 UTC
Created attachment 188378 [details] [review]
Bug 40192: Add additional fields to ERM titles
Comment 6 Martin Renvoize (ashimema) 2025-10-31 09:06:33 UTC
Created attachment 188777 [details] [review]
Bug 40192: Add additional fields support to ERM titles

This patch extends the additional fields framework to ERM e-holdings
titles, allowing libraries to configure custom metadata fields for
managing electronic resources.

Implementation details:
- Extended Koha::ERM::EHoldings::Title and ::Titles with
  AdditionalFields mixin for object-level support
- Added 'erm_titles' table mapping to AdditionalField.pm for API
  serialization
- Updated OpenAPI schema definitions to include extended_attributes
  in erm_eholdings_title.yaml and expose extended_attribute_types
  endpoint
- Enhanced REST API controller to handle additional fields in title
  creation/updates
- Updated admin interface to allow configuring additional fields for
  the 'title' table name
- Modified Vue.js EHoldingsLocalTitleResource component to display
  and manage custom fields

This enables institutions to track custom metadata (e.g., license
details, administrative notes, local identifiers) alongside standard
ERM title information.

Test plan:
1. Configure additional fields:
   - Go to Administration > Additional fields
   - Click "New field" and select table name "title"
   - Create a text field: Name="License notes", Searchable=Yes
   - Create an authorized value field: Name="Access level",
     AV category=LOC (or any available category)
   - Save both fields

2. Test with local ERM titles:
   - Navigate to E-resource management > Local titles
   - Create a new local title or edit an existing one
   - Verify the "Additional fields" section appears with your
     configured fields
   - Fill in "License notes" with test text
   - Select a value for "Access level"
   - Save the title

3. Verify persistence:
   - Reopen the title you just edited
   - Confirm both additional field values are displayed correctly
   - Edit one field value and save
   - Confirm the update persists

Signed-off-by: Michaela <michaela.sieber@kit.edu>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Comment 7 Jonathan Druart 2025-11-04 15:21:00 UTC
Created attachment 189019 [details] [review]
Bug 40192: Add additional fields support to ERM titles

This patch extends the additional fields framework to ERM e-holdings
titles, allowing libraries to configure custom metadata fields for
managing electronic resources.

Implementation details:
- Extended Koha::ERM::EHoldings::Title and ::Titles with
  AdditionalFields mixin for object-level support
- Added 'erm_titles' table mapping to AdditionalField.pm for API
  serialization
- Updated OpenAPI schema definitions to include extended_attributes
  in erm_eholdings_title.yaml and expose extended_attribute_types
  endpoint
- Enhanced REST API controller to handle additional fields in title
  creation/updates
- Updated admin interface to allow configuring additional fields for
  the 'title' table name
- Modified Vue.js EHoldingsLocalTitleResource component to display
  and manage custom fields

This enables institutions to track custom metadata (e.g., license
details, administrative notes, local identifiers) alongside standard
ERM title information.

Test plan:
1. Configure additional fields:
   - Go to Administration > Additional fields
   - Click "New field" and select table name "title"
   - Create a text field: Name="License notes", Searchable=Yes
   - Create an authorized value field: Name="Access level",
     AV category=LOC (or any available category)
   - Save both fields

2. Test with local ERM titles:
   - Navigate to E-resource management > Local titles
   - Create a new local title or edit an existing one
   - Verify the "Additional fields" section appears with your
     configured fields
   - Fill in "License notes" with test text
   - Select a value for "Access level"
   - Save the title

3. Verify persistence:
   - Reopen the title you just edited
   - Confirm both additional field values are displayed correctly
   - Edit one field value and save
   - Confirm the update persists

Signed-off-by: Michaela <michaela.sieber@kit.edu>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Comment 8 Jonathan Druart 2025-11-04 15:21:03 UTC
Created attachment 189020 [details] [review]
Bug 40192: (bug 38446 follow-up) Add title to /erm/extended_attribute_types

Sponsored-by: Karlsruhe Institute of Technology (KIT)