Bug 36618

Summary: Make creation of bibliographic records optional for ERM local titles
Product: Koha Reporter: Matt Blenkinsop <matt.blenkinsop>
Component: ERMAssignee: Matt Blenkinsop <matt.blenkinsop>
Status: Needs documenting --- QA Contact:
Severity: enhancement    
Priority: P5 - low CC: clemens.tubach, fridolin.somers, jonathan.druart, jonathan.field, martin.renvoize, matt.blenkinsop, michaela.sieber, nick, pedro.amorim
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Without this patch creating a local title would always create a bibliographic record in the catalog as well. Now this is optional depending on a checkbox. The checkbox is also available when importing local records form a KBART file.
Version(s) released in:
24.05.00
Bug Depends on:    
Bug Blocks: 34788    
Attachments: Bug 36618: Make biblio creation optional for ERM local titles
Bug 36618: Add unit tests
Bug 36618: Make biblio creation optional for ERM local titles
Bug 36618: Add unit tests
Bug 36618: Make biblio creation optional for ERM local titles
Bug 36618: Add unit tests
Bug 36618: (QA follow-up) Hide option for titles with no linked record
Bug 36618: Make biblio creation optional for ERM local titles
Bug 36618: Add unit tests
Bug 36618: (QA follow-up) Hide option for titles with no linked record
Bug 36618: (follow-up) Fix broken translations

Description Matt Blenkinsop 2024-04-17 09:33:13 UTC
Biblio creation for local titles should be optional at the point of creation. This will then be used for the KBART import feature as well
Comment 1 Matt Blenkinsop 2024-04-17 10:38:34 UTC
Created attachment 164992 [details] [review]
Bug 36618: Make biblio creation optional for ERM local titles

This patch makes biblio creation on local title creation optional.

Test plan:
1) Navigate to the local title creation form
2) Create a title and leave the "Create record" box unchecked
3) Submit the form
4) Search the catalogue for the title you have just created - no biblio result will be available
5) Repeat steps 2 - 3 but this time check the box to create a record
6) You should now be able to find a record in the catalogue for the title you just imported
Comment 2 Matt Blenkinsop 2024-04-17 10:38:37 UTC
Created attachment 164993 [details] [review]
Bug 36618: Add unit tests

prove t/db_dependent/api/v1/erm_eholdings_titles.t
Comment 3 Katrin Fischer 2024-05-03 13:48:23 UTC
Hi Clemens and Michaela,
as you have tested bug 34788, would you mind giving this a sign-off as well? You basically already tested it as it has been part of your testing of bug 34788.
Comment 4 Clemens Tubach 2024-05-03 14:38:30 UTC
(In reply to Katrin Fischer from comment #3)
> Hi Clemens and Michaela,
> as you have tested bug 34788, would you mind giving this a sign-off as well?
> You basically already tested it as it has been part of your testing of bug
> 34788.

Hi Katrin,
I have tried to give the sign-off, but the unit test fails:

Test Summary Report
-------------------
t/db_dependent/api/v1/erm_eholdings_titles.t (Wstat: 512 (exited 2) Tests: 5 Failed: 2)
  Failed tests:  3-4
  Non-zero exit status: 2
Files=1, Tests=5, 15 wallclock secs ( 0.03 usr  0.02 sys + 11.53 cusr  1.81 csys = 13.39 CPU)
Result: FAIL
Comment 5 Clemens Tubach 2024-05-03 15:13:44 UTC
The test works, sorry ...
Comment 6 Clemens Tubach 2024-05-03 15:18:34 UTC
Created attachment 166149 [details] [review]
Bug 36618: Make biblio creation optional for ERM local titles

This patch makes biblio creation on local title creation optional.

Test plan:
1) Navigate to the local title creation form
2) Create a title and leave the "Create record" box unchecked
3) Submit the form
4) Search the catalogue for the title you have just created - no biblio result will be available
5) Repeat steps 2 - 3 but this time check the box to create a record
6) You should now be able to find a record in the catalogue for the title you just imported

Signed-off-by: Clemens Tubach <clemens.tubach@kit.edu>
Comment 7 Clemens Tubach 2024-05-03 15:18:36 UTC
Created attachment 166150 [details] [review]
Bug 36618: Add unit tests

prove t/db_dependent/api/v1/erm_eholdings_titles.t

Signed-off-by: Clemens Tubach <clemens.tubach@kit.edu>
Comment 8 Nick Clemens (kidclamp) 2024-05-07 18:04:39 UTC
From what I see, before this patch the default is to create a bibliographic record when adding a title. This is a change of behavior as the default is now to not create the record. Is it intentional/is this the desired default?

When I create a title with no bibliographic record, then edit it, I see a button to:
Update linked biblio record
If I enabled this, then I create a record. I think this button should either say "Create biblio record" or not be present after I have chosen not to create a biblio the first time?

QA tools complain of tidiness
Comment 9 Matt Blenkinsop 2024-05-08 10:45:02 UTC
Created attachment 166380 [details] [review]
Bug 36618: Make biblio creation optional for ERM local titles

This patch makes biblio creation on local title creation optional.

Test plan:
1) Navigate to the local title creation form
2) Create a title and leave the "Create record" box unchecked
3) Submit the form
4) Search the catalogue for the title you have just created - no biblio result will be available
5) Repeat steps 2 - 3 but this time check the box to create a record
6) You should now be able to find a record in the catalogue for the title you just imported
Comment 10 Matt Blenkinsop 2024-05-08 10:45:05 UTC
Created attachment 166381 [details] [review]
Bug 36618: Add unit tests

prove t/db_dependent/api/v1/erm_eholdings_titles.t
Comment 11 Matt Blenkinsop 2024-05-08 10:45:07 UTC
Created attachment 166382 [details] [review]
Bug 36618: (QA follow-up) Hide option for titles with no linked record

This patch hides the "Update linked biblio" option for titles that have been created with no linked biblio record
Comment 12 Matt Blenkinsop 2024-05-08 10:46:49 UTC
I've fixed the tidying issues and changed it so that it hides the option to update the linked record when updating a title that doesn't have a linked record. I think it makes more sense that eventually the import tool in bug 34788 is expanded to be able to do batch record additions/updates for titles and it also avoids accidental creation of records in the short term
Comment 13 Nick Clemens (kidclamp) 2024-05-08 11:12:24 UTC
Created attachment 166386 [details] [review]
Bug 36618: Make biblio creation optional for ERM local titles

This patch makes biblio creation on local title creation optional.

Test plan:
1) Navigate to the local title creation form
2) Create a title and leave the "Create record" box unchecked
3) Submit the form
4) Search the catalogue for the title you have just created - no biblio result will be available
5) Repeat steps 2 - 3 but this time check the box to create a record
6) You should now be able to find a record in the catalogue for the title you just imported

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 14 Nick Clemens (kidclamp) 2024-05-08 11:12:27 UTC
Created attachment 166387 [details] [review]
Bug 36618: Add unit tests

prove t/db_dependent/api/v1/erm_eholdings_titles.t

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 15 Nick Clemens (kidclamp) 2024-05-08 11:12:29 UTC
Created attachment 166388 [details] [review]
Bug 36618: (QA follow-up) Hide option for titles with no linked record

This patch hides the "Update linked biblio" option for titles that have been created with no linked biblio record

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 16 Katrin Fischer 2024-05-08 17:32:56 UTC
1) Translatability

I don't believe that Update and Create will be picked up by the translation scripts in this construct:

+                    <legend>
+                        {{
+                            $__("%s linked biblio record").format(
+                                title.title_id ? "Update" : "Create"
+                            )
+                        }}:
+                    </legend>
+                    <label for="create_linked_biblio"
+                        >{{
+                            $__("%s record").format(
+                                title.title_id ? "Update" : "Create"
+                            )
+                        }}:</label
+                    >

Please follow-up!
Comment 17 Katrin Fischer 2024-05-08 17:50:40 UTC
In general, don't try to be too clever with things like that. It makes it harder to translate in the translations tools if you cut up sentences. Most of the time it's better to just have 2 full strings to translate because it adds context and looks less confusing in the tools.
Comment 18 Katrin Fischer 2024-05-08 18:06:17 UTC
Pushed for 24.05!

Well done everyone, thank you!
Comment 19 Martin Renvoize 2024-05-22 13:49:45 UTC
What's the additional work needed here?
Comment 20 Katrin Fischer 2024-05-22 14:01:13 UTC
(In reply to Martin Renvoize from comment #19)
> What's the additional work needed here?

Comment #16 - broken strings. As it will only "add strings" I'd be happy to still push.
Comment 21 Matt Blenkinsop 2024-05-23 13:49:21 UTC
Created attachment 167111 [details] [review]
Bug 36618: (follow-up) Fix broken translations
Comment 22 Katrin Fischer 2024-05-23 15:47:43 UTC
Thanks!
Comment 23 Katrin Fischer 2024-05-23 15:56:54 UTC
Pushed for 24.05!

Well done everyone, thank you!
Comment 24 Fridolin Somers 2024-05-24 15:08:23 UTC
Not backported to 23.11.x