Bug 35471

Summary: Automatically select child MARC framework when adding child records
Product: Koha Reporter: Lari Taskula <lari.taskula>
Component: CatalogingAssignee: Lari Taskula <lari.taskula>
Status: Needs Signoff --- QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: angela.berrett, m.de.rooy, paivi.knuutinen
Version: unspecified   
Hardware: All   
OS: All   
GIT URL: Initiative type: ---
Sponsorship status: --- Crowdfunding goal: 0
Patch complexity: --- Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: Bug 35471: Add column parent_frameworkcode to table biblio_framework
Bug 35471: DBIx changes
Bug 35471: Add support for selecting parent framework on MARC framework modification screen
Bug 35471: List child frameworks on MARC modification screen
Bug 35471: List parent frameworks on MARC framework list screen
Bug 35471: Add Koha::Template::Plugin::Frameworks->GetChildren()
Bug 35471: Add child frameworks to cataloguing toolbar's new child record button
Bug 35471: Add child frameworks to cataloguing toolbar's new child record button
Bug 35471: Add column parent_frameworkcode to table biblio_framework
Bug 35471: DBIx changes
Bug 35471: Add support for selecting parent framework on MARC framework modification screen
Bug 35471: List child frameworks on MARC modification screen
Bug 35471: List parent frameworks on MARC framework list screen
Bug 35471: Add Koha::Template::Plugin::Frameworks->GetChildren()
Bug 35471: Add child frameworks to cataloguing toolbar's new child record button
Bug 35471: Add column parent_frameworkcode to table biblio_framework
Bug 35471: DBIx changes
Bug 35471: Add support for selecting parent framework on MARC framework modification screen
Bug 35471: List child frameworks on MARC modification screen
Bug 35471: List parent frameworks on MARC framework list screen
Bug 35471: Add Koha::Template::Plugin::Frameworks->GetChildren()
Bug 35471: Add child frameworks to cataloguing toolbar's new child record button
Bug 35471: Add child frameworks to cataloguing toolbar's new child record button
Bug 35471: Add column parent_frameworkcode to table biblio_framework
Bug 35471: DBIx changes
Bug 35471: Add support for selecting parent framework on MARC framework modification screen
Bug 35471: List child frameworks on MARC modification screen
Bug 35471: List parent frameworks on MARC framework list screen
Bug 35471: Add Koha::Template::Plugin::Frameworks->GetChildren()
Bug 35471: Add child frameworks to cataloguing toolbar's new child record button
Bug 35471: Add column parent_frameworkcode to table biblio_framework
Bug 35471: DBIx changes
Bug 35471: Add support for selecting parent framework on MARC framework modification screen
Bug 35471: List child frameworks on MARC modification screen
Bug 35471: List parent frameworks on MARC framework list screen
Bug 35471: Add Koha::Template::Plugin::Frameworks->GetChildren()
Bug 35471: Add child frameworks to cataloguing toolbar's new child record button

Description Lari Taskula 2023-12-01 22:41:12 UTC
Some libraries create their own MARC frameworks for component/child records. When adding a child record through host record, Koha currently selects the default MARC framework and a librarian must manually change to the child record framework.

This Bug adds a parent-child relationship to MARC frameworks and aims to skip the manual step of selecting child record framework.

The goal is to automatically select child MARC framework when adding child record through the host record.

To reproduce problem:
Administration -> MARC bibliographic framework
1. Create framework with frameworkcode "A"
2. Create framework with frameworkcode "A-child"

Record view
1. Save record with framework "A"
2. Navigate to a record
3. Click "+ New", a drop-down opens
4. Click "New child record"
5. After add biblio form opens, click "Settings"
6. Observe default framework selected
7. You must manually select "A-child framework"

After this change,
To test:
Administration -> MARC bibliographic framework
1. Create framework with frameworkcode "A"
2. Create framework with frameworkcode "A-child"
3. Set "A" as "A-child" 's parent framework

Record view
1. Save record with framework "A"
2. Navigate to a record
3. Click "+ New", a drop-down opens
4. Click "New child record"
5. After add biblio form opens, click "Settings"
6. Observe "A-child" framework automatically selected
Comment 1 Lari Taskula 2023-12-01 23:07:23 UTC Comment hidden (obsolete)
Comment 2 Lari Taskula 2023-12-01 23:07:26 UTC Comment hidden (obsolete)
Comment 3 Lari Taskula 2023-12-01 23:07:28 UTC Comment hidden (obsolete)
Comment 4 Lari Taskula 2023-12-01 23:07:30 UTC Comment hidden (obsolete)
Comment 5 Lari Taskula 2023-12-01 23:07:33 UTC Comment hidden (obsolete)
Comment 6 Lari Taskula 2023-12-01 23:07:35 UTC Comment hidden (obsolete)
Comment 7 Lari Taskula 2023-12-01 23:07:37 UTC Comment hidden (obsolete)
Comment 8 Lari Taskula 2023-12-01 23:14:08 UTC Comment hidden (obsolete)
Comment 9 Lari Taskula 2023-12-01 23:16:09 UTC Comment hidden (obsolete)
Comment 10 Lari Taskula 2023-12-01 23:16:11 UTC Comment hidden (obsolete)
Comment 11 Lari Taskula 2023-12-01 23:16:13 UTC Comment hidden (obsolete)
Comment 12 Lari Taskula 2023-12-01 23:16:16 UTC Comment hidden (obsolete)
Comment 13 Lari Taskula 2023-12-01 23:16:18 UTC Comment hidden (obsolete)
Comment 14 Lari Taskula 2023-12-01 23:16:21 UTC Comment hidden (obsolete)
Comment 15 Lari Taskula 2023-12-01 23:16:23 UTC Comment hidden (obsolete)
Comment 16 Lari Taskula 2023-12-05 00:58:45 UTC Comment hidden (obsolete)
Comment 17 Lari Taskula 2023-12-05 00:58:48 UTC Comment hidden (obsolete)
Comment 18 Lari Taskula 2023-12-05 00:58:50 UTC Comment hidden (obsolete)
Comment 19 Lari Taskula 2023-12-05 00:58:53 UTC Comment hidden (obsolete)
Comment 20 Lari Taskula 2023-12-05 00:58:55 UTC Comment hidden (obsolete)
Comment 21 Lari Taskula 2023-12-05 00:58:57 UTC Comment hidden (obsolete)
Comment 22 Lari Taskula 2023-12-05 00:59:00 UTC Comment hidden (obsolete)
Comment 23 Lari Taskula 2023-12-05 01:07:04 UTC
I know qa-tools is complaining about tidiness, I tried my best fixing the issues but eventually had to give up as I'm not able to resolve them.

KomodoIDE/perltidy v20230912/perltidy command line arguments: -pro=/kohapath/.perltidyrc , Code -> Format -> Selection using perltidy

How do I know which lines are less tidy exactly? Can koha-qa tell me that?
Comment 24 OpenFifth Sandboxes 2023-12-15 11:56:24 UTC
Created attachment 159884 [details] [review]
Bug 35471: Add child frameworks to cataloguing toolbar's new child record button

To test:
Administration -> MARC bibliographic framework
1. Create framework with frameworkcode "A"
2. Create framework with frameworkcode "A-1"
3. Set "A" as "A-1" 's parent framework

Record view
1. Save record with framework "A"
2. Navigate to a record
3. Click "+ New", a drop-down opens
4. Click "New child record"
5. After add biblio form opens, click "Settings"
6. Observe "A-1" framework automatically selected

Sponsored-by: Hypernova Oy
Signed-off-by: Päivi Knuutinen <paivi.knuutinen@joensuu.fi>
Comment 25 Päivi Knuutinen 2023-12-15 12:07:46 UTC
I tested this at sandbox and it works.
Comment 26 Lari Taskula 2025-10-09 06:20:45 UTC Comment hidden (obsolete)
Comment 27 Lari Taskula 2025-10-09 06:20:48 UTC Comment hidden (obsolete)
Comment 28 Lari Taskula 2025-10-09 06:20:50 UTC Comment hidden (obsolete)
Comment 29 Lari Taskula 2025-10-09 06:20:52 UTC Comment hidden (obsolete)
Comment 30 Lari Taskula 2025-10-09 06:20:54 UTC Comment hidden (obsolete)
Comment 31 Lari Taskula 2025-10-09 06:20:56 UTC Comment hidden (obsolete)
Comment 32 Lari Taskula 2025-10-09 06:20:59 UTC Comment hidden (obsolete)
Comment 33 Lari Taskula 2025-10-09 07:28:28 UTC
Created attachment 187620 [details] [review]
Bug 35471: Add column parent_frameworkcode to table biblio_framework
Comment 34 Lari Taskula 2025-10-09 07:28:30 UTC
Created attachment 187621 [details] [review]
Bug 35471: DBIx changes
Comment 35 Lari Taskula 2025-10-09 07:28:33 UTC
Created attachment 187622 [details] [review]
Bug 35471: Add support for selecting parent framework on MARC framework modification screen

To test:
1. Navigate to Administration -> MARC bibliographic framework
2. Create MARC framework with frameworkcode "A"
3. Observe new field "Parent framework" when adding a new framework
4. After adding the framework, click Actions -> MARC structure
5. Select "Create framework for A" using "Default", click OK
6. Navigate back to frameworks listing
7. Create framework with frameworkcode "A-1"
8. Select framework you created at step 2 as the parent framework
9. After adding the framework, click Actions -> MARC structure
10. Select "Create framework for A-1" using "Default", click OK
Comment 36 Lari Taskula 2025-10-09 07:28:35 UTC
Created attachment 187623 [details] [review]
Bug 35471: List child frameworks on MARC modification screen

1. Navigate to Administration -> MARC bibliographic framework
2. Select the parent framework you added in previous patch
3. Observe child framework being listed
Comment 37 Lari Taskula 2025-10-09 07:28:37 UTC
Created attachment 187624 [details] [review]
Bug 35471: List parent frameworks on MARC framework list screen

1. Navigate to Administration -> MARC bibliographic framework
2. Observe new column "Parent framework"
3. Observe parent framework being populated for the child framework
   you added in previous patch
Comment 38 Lari Taskula 2025-10-09 07:28:39 UTC
Created attachment 187625 [details] [review]
Bug 35471: Add Koha::Template::Plugin::Frameworks->GetChildren()

To test:
1. prove t/db_dependent/Koha/Template/Plugin/Frameworks.t
Comment 39 Lari Taskula 2025-10-09 07:28:42 UTC
Created attachment 187626 [details] [review]
Bug 35471: Add child frameworks to cataloguing toolbar's new child record button

To test:
Administration -> MARC bibliographic framework
1. Create framework with frameworkcode "A"
2. Create framework with frameworkcode "A-1"
3. Set "A" as "A-1" 's parent framework

Record view
1. Save record with framework "A"
2. Navigate to a record
3. Click "+ New", a drop-down opens
4. Click "New child record"
5. After add biblio form opens, click "Settings"
6. Observe "A-1" framework automatically selected

Signed-off-by: Päivi Knuutinen <paivi.knuutinen@joensuu.fi>