Bug 31717 - Value builder unimarc_field_010.pl should also use 214$c
Summary: Value builder unimarc_field_010.pl should also use 214$c
Status: Failed QA
Alias: None
Product: Koha
Classification: Unclassified
Component: Cataloging (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Fridolin Somers
QA Contact: Marcel de Rooy
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-10-07 20:19 UTC by Fridolin Somers
Modified: 2026-02-27 10:02 UTC (History)
3 users (show)

See Also:
GIT URL:
Initiative type: ---
Sponsorship status: ---
Comma delimited list of Sponsors:
Crowdfunding goal: 0
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
This updates the unimarc_field_010.pl value builder for UNIMARC systems. If the value builder finds a publisher from the ISBN entered in 010$a, it now automatically adds the publisher to the 214$c (in addition to the existing 210$c).
Version(s) released in:
Circulation function:


Attachments
Bug 31717: Value builder unimarc_field_010.pl also use 214$c (1.65 KB, patch)
2022-10-07 20:40 UTC, Fridolin Somers
Details | Diff | Splinter Review
Bug 31717: Value builder unimarc_field_010.pl also use 214$c (1.65 KB, patch)
2025-12-23 14:40 UTC, Fridolin Somers
Details | Diff | Splinter Review
Bug 31717: Value builder unimarc_field_010.pl also use 214$c (1.69 KB, patch)
2025-12-23 15:10 UTC, Fridolin Somers
Details | Diff | Splinter Review
Bug 31717: Value builder unimarc_field_010.pl also use 214$c (1.74 KB, patch)
2025-12-23 22:44 UTC, David Nind
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Fridolin Somers 2022-10-07 20:19:12 UTC
Value builder unimarc_field_010.pl tries to find publisher from ISBN in order to fill 210$c.
Since there is now 214$c for publisher this value builder should be adapted.
Comment 1 Fridolin Somers 2022-10-07 20:40:58 UTC
Created attachment 141523 [details] [review]
Bug 31717: Value builder unimarc_field_010.pl also use 214$c

Value builder unimarc_field_010.pl tries to find publisher from ISBN in order to fill 210$c.
Since there is now 214$c for publisher this value builder should be adapted.

Test plan :
1) Choose an existing record with an ISBN and a published in biblioitems.publishercode,
   For example 9782070612369 and Gallimard
2) Use value builder unimarc_field_010.pl on 010$a
3) Create a new record
4) Enter 9782070612369 in 010$a
5) Click on value builder icon on this subfield
6) Check you see 'Gallimard' in 214$c
Comment 2 David Nind 2022-10-27 10:14:36 UTC
I had a go at testing this, but couldn't get it to work. 

I'm not sure what I'm doing wrong... I'm sure it is something basic!

What I did:

1. Before applying the patch, I checked the current behaviour:
   . Added unimarc_field_010.pl to 010$a
   . Created a new record 
   . Entered 9782070612369 in 010$a 
   . Checked 210$c - automatically populated with Gallimard

2. After applying the patch (and flush_memcached, restart_all, fresh browser):
   . Created a new record
   . Entered 9782070612369 in 010$a 
   . Checked 210$c - still automatically populated with Gallimard
   . Checked 214$c - not automatically populated with Gallimard
Comment 3 Amaury GAU 2023-01-23 14:43:01 UTC
I'm not even there at testing.


I did : 

1) Choose an existing record with an ISBN and a published in biblioitems.publishercode. I used2211015344 and Ecole des loisirs

2)I don't see the value builder unimarc_field_010.pl on 010$a. 


I'm not sure about the process here.
Comment 4 Fridolin Somers 2023-01-24 06:25:58 UTC
(In reply to Amaury GAU from comment #3)
> I'm not even there at testing.
> 
> 
> I did : 
> 
> 1) Choose an existing record with an ISBN and a published in
> biblioitems.publishercode. I used2211015344 and Ecole des loisirs
> 
> 2)I don't see the value builder unimarc_field_010.pl on 010$a. 
> 
> 
> I'm not sure about the process here.

Hi,

You need to test on a UNIMARC database.
Configure framework on 010$a if needed.
Comment 5 Amaury GAU 2023-01-24 09:59:42 UTC
(In reply to Fridolin Somers from comment #4) 
> Hi,
> 
> You need to test on a UNIMARC database.
> Configure framework on 010$a if needed.

Hi,

1) I went to Koha Adminstration/Catalog/MARC bibliographic framework.
There, in all the frameworks: Actions > Marc structure > 010 Actions > Edit subfield > a > plugin > unimarc_field_010.pl > Save

2) In cataloging, I added a new record in agreement with the framework I installed the plugin in. 

3) I found a tag editor on 10$a, but it was not clickable. 

4) Entered the ISBN 2211015344, 210$c automatically filled but 214$c was not.


Did I miss something else maybe ?
Comment 6 Fridolin Somers 2023-01-26 06:23:13 UTC
Ah it is a Javascript change, try refreshing cache after applying patch :
Ctrl + F5
Comment 7 David Nind 2023-08-26 20:13:24 UTC
Good news, the patch still applies!

Not so good news, as in comment #2 and comment #5 it still doesn't work as expected.

After applying the patch, everything was restarted (flush_memcached) and a fresh browser (with cache cleared) was used.
Comment 8 Fridolin Somers 2025-12-23 14:40:25 UTC
Created attachment 190703 [details] [review]
Bug 31717: Value builder unimarc_field_010.pl also use 214$c

Value builder unimarc_field_010.pl tries to find publisher from ISBN in order to fill 210$c.
Since there is now 214$c for publisher this value builder should be adapted.

Test plan :
1) Choose an existing record with an ISBN and a published in biblioitems.publishercode,
   For example 9782070612369 and Gallimard
2) Use value builder unimarc_field_010.pl on 010$a
3) Create a new record
4) Enter 9782070612369 in 010$a
5) Click on value builder icon on this subfield
6) Check you see 'Gallimard' in 214$c
Comment 9 Fridolin Somers 2025-12-23 14:41:07 UTC
Patch rebased.

Could you try again please ?
Comment 10 Fridolin Somers 2025-12-23 15:10:23 UTC
Created attachment 190705 [details] [review]
Bug 31717: Value builder unimarc_field_010.pl also use 214$c

Value builder unimarc_field_010.pl tries to find publisher from ISBN in order to fill 210$c.
Since there is now 214$c for publisher this value builder should be adapted.

Test plan :
1) Choose an existing record with an ISBN and a published in biblioitems.publishercode,
   For example 9782070612369 and Gallimard
2) Use value builder unimarc_field_010.pl on 010$a
3) Create a new record
4) Enter 9782070612369 in 010$a
5) Click on value builder icon on this subfield
6) Check you see 'Gallimard' in 214$c
Comment 11 Fridolin Somers 2025-12-23 15:11:15 UTC
I've changed the patch, it was stopping at first input.

Please retest :D
Comment 12 David Nind 2025-12-23 22:44:51 UTC
Created attachment 190707 [details] [review]
Bug 31717: Value builder unimarc_field_010.pl also use 214$c

Value builder unimarc_field_010.pl tries to find publisher from ISBN in order to fill 210$c.
Since there is now 214$c for publisher this value builder should be adapted.

Test plan :
1) Choose an existing record with an ISBN and a published in biblioitems.publishercode,
   For example 9782070612369 and Gallimard
2) Use value builder unimarc_field_010.pl on 010$a
3) Create a new record
4) Enter 9782070612369 in 010$a
5) Click on value builder icon on this subfield
6) Check you see 'Gallimard' in 214$c

Signed-off-by: David Nind <david@davidnind.com>
Comment 13 Marcel de Rooy 2026-02-27 08:55:35 UTC
Hmm. This is a tiny change but the plugin itself seems to ask for more attention?

It is still in the old style with plugin_javascript instead of builder/launcher. No blocker btw.

It seems that it actually does not need a launcher since it only needs an ajax call for the publishercode. But it does to by calling the launcher from the builder, which is a bit odd. (Too much overhead?) No blocker too.

The function operates on the Blur event; do we really need to fetch the publishercode (again) if the field did not change? Or should we just use Change?

Why write the same code to two fields now? I did not check the UNIMARC specs, but is it really meant to duplicate info here? Or is it meant to use only one of the two?

Changing status for feedback.
Comment 14 Fridolin Somers 2026-02-27 09:53:56 UTC
> Why write the same code to two fields now? I did not check the UNIMARC specs, but is it really meant to duplicate info here? Or is it meant to use only one of the two?

It is new from bibliographic transition.
214 is more complex that 210, it meant to use only one of the two.

We can find the info here :
https://www.transition-bibliographique.fr/unimarc/manuel-unimarc-format-bibliographique/#Bloc2XX

For the other points, we may create a bug report to rewrite this value builder.
Maybe we will use API here at some point.
Comment 15 Marcel de Rooy 2026-02-27 10:02:17 UTC
(In reply to Fridolin Somers from comment #14)
> > Why write the same code to two fields now? I did not check the UNIMARC specs, but is it really meant to duplicate info here? Or is it meant to use only one of the two?
> 
> It is new from bibliographic transition.
> 214 is more complex that 210, it meant to use only one of the two.

In that case we need a code adjustment to reflect that.