Bug 14199 - Unify all organization code plugins
Summary: Unify all organization code plugins
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Cataloging (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Marcel de Rooy
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-05-14 10:18 UTC by Marcel de Rooy
Modified: 2017-06-14 22:05 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 14199: Unify marc orgcode plugins, not overwriting existing values (3.41 KB, patch)
2015-07-11 17:43 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 14199: Modify webinstaller sql files for marc21_orgcode plugin (254.90 KB, patch)
2015-07-11 17:43 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 14199: Database revision for marc21_orgcode.pl (6.16 KB, patch)
2015-07-11 17:43 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 14199: Modify webinstaller sql files for marc21_orgcode plugin (244.37 KB, patch)
2015-09-14 11:29 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 14199: Database revision for marc21_orgcode.pl (6.16 KB, patch)
2015-09-14 11:29 UTC, Marcel de Rooy
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 14199: Unify marc orgcode plugins, not overwriting existing values (3.44 KB, patch)
2015-10-26 21:21 UTC, Bernardo Gonzalez Kriegel
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 14199: Modify webinstaller sql files for marc21_orgcode plugin (244.31 KB, patch)
2015-10-26 21:21 UTC, Bernardo Gonzalez Kriegel
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 14199: Database revision for marc21_orgcode.pl (6.25 KB, patch)
2015-10-26 21:21 UTC, Bernardo Gonzalez Kriegel
Details | Diff | Splinter Review
Bug 14199: Modify webinstaller sql files for marc21_orgcode plugin (212.27 KB, patch)
2016-01-04 11:03 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 14199: Unify marc orgcode plugins, not overwriting existing values (3.50 KB, patch)
2016-01-19 09:51 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 14199: Database revision for marc21_orgcode.pl (6.31 KB, patch)
2016-01-19 09:51 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 14199: Modify webinstaller sql files for marc21_orgcode plugin (212.21 KB, patch)
2016-01-19 09:51 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Marcel de Rooy 2015-05-14 10:18:51 UTC
We are using several plugins to do the same.
See marc21_field_040c and 040d.
There must be even some more: 003.
Seems not to be used at unimarc side.
Comment 1 Marcel de Rooy 2015-07-11 17:43:32 UTC Comment hidden (obsolete)
Comment 2 Marcel de Rooy 2015-07-11 17:43:40 UTC Comment hidden (obsolete)
Comment 3 Marcel de Rooy 2015-07-11 17:43:44 UTC Comment hidden (obsolete)
Comment 4 Marcel de Rooy 2015-09-14 11:29:26 UTC Comment hidden (obsolete)
Comment 5 Marcel de Rooy 2015-09-14 11:29:31 UTC Comment hidden (obsolete)
Comment 6 Marcel de Rooy 2015-09-14 11:30:48 UTC
Rebased. File marc21_simple_bib_frameworks.sql is no longer touched.
Hope this attracts some more attention than thus far ;)
Comment 7 Bernardo Gonzalez Kriegel 2015-10-26 21:21:02 UTC Comment hidden (obsolete)
Comment 8 Bernardo Gonzalez Kriegel 2015-10-26 21:21:11 UTC Comment hidden (obsolete)
Comment 9 Bernardo Gonzalez Kriegel 2015-10-26 21:21:19 UTC Comment hidden (obsolete)
Comment 10 Katrin Fischer 2015-11-16 19:31:39 UTC
Hi Marcel,

can you please fix the patches to work with the renamed files from bug 15181?
Comment 11 Marcel de Rooy 2016-01-04 10:39:52 UTC
(In reply to Katrin Fischer from comment #10)
> Hi Marcel,
> 
> can you please fix the patches to work with the renamed files from bug 15181?

The big change that affects this patch, comes from:
b2c302440b7d33e8dc3923b645286a70111dd305 Bug 15097: Update MARC21 de-DE frameworks to Update 21 (September 2015)
Comment 12 Katrin Fischer 2016-01-04 10:44:56 UTC
How is that? Maybe it's bug 10963?
Comment 13 Katrin Fischer 2016-01-04 10:57:16 UTC
Ah sorry, missed looking at the second patch - but I think some more frameworks updated since (it-IT?)
Comment 14 Marcel de Rooy 2016-01-04 11:03:48 UTC Comment hidden (obsolete)
Comment 15 Jonathan Druart 2016-01-19 09:51:01 UTC
Created attachment 46851 [details] [review]
Bug 14199: Unify marc orgcode plugins, not overwriting existing values

This patch copies code from marc21_field_003.pl to create marc21_orgcode.pl
for more generic use. Other fields like 040c or 040d should use it too.
Note: The plugin is used for authorities too (003, 040a).

One behaviour change is added: If the corresponding field is already
filled, it will not be overwritten.

In the unit test marc21_orgcode already replaces marc21_field_003.

Test plan:
[1] Attach plugin marc21_orgcode to a field (e.g. 003) and test it in
    the MARC editor of Cataloguing or Authorities.
[2] Check if a value is not overwritten any more.
[3] Run unit test t/db_dependent/FrameworkPlugin.t; don't be distracted by
    the noisy warnings of marc21_field_007.pl. They will be addressed on
    another report.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 16 Jonathan Druart 2016-01-19 09:51:06 UTC
Created attachment 46852 [details] [review]
Bug 14199: Database revision for marc21_orgcode.pl

This patch adds the dbrev in atomicupdate, updating the marc structure
for existing installations. (New installation in previous patch.)
And it removes the obsolete plugin files.

Test plan:
Run upgrade. Verify that new plugin is linked (for bib and auth).
Check plugin in editor.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Plugin tested, added to 040a/c/d
Test pass
No koha-qa errors

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 17 Jonathan Druart 2016-01-19 09:51:11 UTC
Created attachment 46853 [details] [review]
Bug 14199: Modify webinstaller sql files for marc21_orgcode plugin

This patch updates the sql installer files for new installations.
Occurrences to the three plugins marc21_field_003, 040c and 040d are
replaced by marc21_orgcode.pl.
This has been generated by one sed statement.

Test plan:
[1] Run a new installation or run some of the changed sql files manually.
[2] Verify that marc21_orgcode is linked to fields previously linked to
    the three old plugins.
[3] Do a git grep on the three plugin file names. No occurrences expected.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Have tested the three english sql files:
authorities_normal_marc21.sql: 18 rows with marc21_orgcode (003 and 040a
for 9 auth codes)
marc21_framework_DEFAULT.sql: 1 row with marc21_orgcode (003) -- this patch
does not add them to 040c or 040d; no behavior change..
marc21_simple_bib_frameworks.sql: 8 rows (003 for 8 frameworks)

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
The following files do no longer need an adjustment:
installer/data/mysql/de-DE/marcflavour/marc21/optional/marc21_simple_bib_frameworks.sql
installer/data/mysql/es-ES/marcflavour/marc21/optional/marc21_simple_bib_frameworks.sql
installer/data/mysql/it-IT/marcflavour/marc21/optional/marc21_simple_bib_frameworks.sql
For details, check Bug 15097: Update MARC21 de-DE frameworks to Update 21.
And similar reports for es-ES and it-IT.
Verified this change by installing de-DE in the webinstaller. The plugin for
field 003 was correctly set to marc21_orgcode.pl.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 18 Kyle M Hall 2016-02-26 14:08:40 UTC
Pushed to master, thanks Marcel! Should be in Koha 3.24