Bug 22470 - Missing the table name on misc/migration_tools/switch_marc21_series_info.pl
Summary: Missing the table name on misc/migration_tools/switch_marc21_series_info.pl
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Command-line Utilities (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor (vote)
Assignee: David Roberts
QA Contact: Testopia
URL:
Keywords: Academy
Depends on:
Blocks:
 
Reported: 2019-03-07 09:09 UTC by George Veranis
Modified: 2021-12-13 21:09 UTC (History)
7 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
20.11.00, 20.05.01, 19.11.07, 19.05.13


Attachments
Bug 22470: Missing the table name on misc/migration_tools/switch_marc21_series_info.pl (1.92 KB, patch)
2020-05-09 16:09 UTC, David Roberts
Details | Diff | Splinter Review
Bug 22470: Missing the table name on misc/migration_tools/switch_marc21_series_info.pl (2.19 KB, patch)
2020-05-16 08:36 UTC, Andreas Roussos
Details | Diff | Splinter Review
Bug 22470: Missing the table name on misc/migration_tools/switch_marc21_series_info.pl (2.25 KB, patch)
2020-05-21 13:19 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description George Veranis 2019-03-07 09:09:57 UTC
UPDATE marc_subfield_structure SET kohafield='seriestitle' - it's missing the table name
it should be 
   $dbh->do(
"UPDATE marc_subfield_structure SET kohafield='biblio.seriestitle'
  WHERE tagfield='490' AND tagsubfield='a'"
    );
    $dbh->do(
"UPDATE marc_subfield_structure SET kohafield='biblio.volume'
  WHERE tagfield='490' AND tagsubfield='v'"
    );

    # empty old koha fields
    $dbh->do(
"UPDATE marc_subfield_structure SET kohafield=''
  WHERE kohafield='biblio.seriestitle' AND tagfield='440' AND tagsubfield='a'"
        );
    $dbh->do(
"UPDATE marc_subfield_structure SET kohafield=''
  WHERE kohafield='biblio.volume' AND tagfield='440' AND tagsubfield='v'"
        );

lines 232-249
Comment 1 George Veranis 2019-03-07 09:20:02 UTC
  $dbh->do(
"UPDATE marc_subfield_structure SET kohafield='biblio.seriestitle'
  WHERE tagfield='490' AND tagsubfield='a'"
    );
    $dbh->do(
"UPDATE marc_subfield_structure SET kohafield='biblioitems.volume'
  WHERE tagfield='490' AND tagsubfield='v'"
    );

    # empty old koha fields
    $dbh->do(
"UPDATE marc_subfield_structure SET kohafield=''
  WHERE kohafield='biblio.seriestitle' AND tagfield='440' AND tagsubfield='a'"
        );
    $dbh->do(
"UPDATE marc_subfield_structure SET kohafield=''
  WHERE kohafield='biblioitems.volume' AND tagfield='440' AND tagsubfield='v'"
        );

lines 232-249
Comment 2 George Veranis 2019-03-07 10:10:46 UTC
also add

  $dbh->do(
"UPDATE marc_subfield_structure SET kohafield=''
  WHERE kohafield='biblioitems.number' AND tagfield='440' AND tagsubfield='n'"
        );
Comment 3 Katrin Fischer 2019-11-24 21:52:05 UTC
Changing back to default assignee.
Comment 4 David Roberts 2020-05-09 16:09:48 UTC
Created attachment 104627 [details] [review]
Bug 22470: Missing the table name on misc/migration_tools/switch_marc21_series_info.pl

This patch adds the table name to the SQL update statements.

To test:

1) Apply the patch
2) Run the script. Check that there are no errors, and that the script
behaves as expected.
Comment 5 David Roberts 2020-05-09 16:10:41 UTC
I'm not 100% sure I understand what this script is meant to do, but I've made the suggested edits and as far as I can see the script runs without errors and moves series data into the different fields.
Comment 6 Andreas Roussos 2020-05-16 08:34:57 UTC
(In reply to David Roberts from comment #5)
> I'm not 100% sure I understand what this script is meant to do, but I've
> made the suggested edits and as far as I can see the script runs without
> errors and moves series data into the different fields.
As I understand it, this script was created in light of the changes in the
MARC21 standard relating to field 440. According to the "FIELD DEFINITION
AND SCOPE" section in https://www.loc.gov/marc/bibliographic/bd440.html,
field 440 was made obsolete in 2008.
Comment 7 Andreas Roussos 2020-05-16 08:36:34 UTC
Created attachment 104981 [details] [review]
Bug 22470: Missing the table name on misc/migration_tools/switch_marc21_series_info.pl

This patch adds the table name to the SQL update statements.

To test:

1) Apply the patch
2) Run the script. Check that there are no errors, and that the script
behaves as expected.

Signed-off-by: Andreas Roussos <a.roussos@dataly.gr>
Created a test record with values in field 440. Applied the patch, ran the
script with the -c -f flags and observed that the values were moved to field
490. Also, the relevant Koha to MARC mappings were changed accordingly.
Comment 8 Katrin Fischer 2020-05-21 13:19:43 UTC
Created attachment 105191 [details] [review]
Bug 22470: Missing the table name on misc/migration_tools/switch_marc21_series_info.pl

This patch adds the table name to the SQL update statements.

To test:

1) Apply the patch
2) Run the script. Check that there are no errors, and that the script
behaves as expected.

Signed-off-by: Andreas Roussos <a.roussos@dataly.gr>
Created a test record with values in field 440. Applied the patch, ran the
script with the -c -f flags and observed that the values were moved to field
490. Also, the relevant Koha to MARC mappings were changed accordingly.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 9 Jonathan Druart 2020-06-15 09:59:12 UTC
Pushed to master for 20.11, thanks to everybody involved!
Comment 10 Lucas Gass 2020-06-17 23:17:03 UTC
backported to 20.05.x for 20.05.01
Comment 11 Aleisha Amohia 2020-06-22 04:30:43 UTC
backported to 19.11.x for 19.11.07
Comment 12 Victor Grousset/tuxayo 2020-07-03 06:02:15 UTC
Backported to 19.05.x branch for 19.05.13