Bug 25867: Database update for changing existing frameworks

This updates the descriptions for 952$a und $b in all existing
frameworks, if the English description hasn't been changed since
installing Koha.

To test:
- Look at your item edit form or on the MARC tab
  for the descriptions shown for $a and $b for any framework
- Note the descriptons say '... location'
- Change one or more using the frameworks.
- Run the database update
- Verify only the unchanged ones have been updated

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Katrin Fischer 2020-08-14 13:17:01 +00:00 committed by Jonathan Druart
parent cad0cbee6d
commit 7c0cf2c73e

View file

@ -0,0 +1,14 @@
$DBversion = 'XXX'; # will be replaced by the RM
if( CheckVersion( $DBversion ) ) {
$dbh->do( "UPDATE marc_subfield_structure SET liblibrarian = 'Home library' WHERE liblibrarian = 'Permanent location'
AND tagfield = 952 and tagsubfield = 'a'" );
$dbh->do( "UPDATE marc_subfield_structure SET libopac = 'Home library' WHERE libopac = 'Permanent location'
AND tagfield = 952 and tagsubfield = 'a'" );
$dbh->do( "UPDATE marc_subfield_structure SET liblibrarian = 'Current library' WHERE liblibrarian = 'Current location'
AND tagfield = 952 and tagsubfield = 'b'" );
$dbh->do( "UPDATE marc_subfield_structure SET libopac = 'Current library' WHERE libopac = 'Current location'
AND tagfield = 952 and tagsubfield = 'b'" );
NewVersion( $DBversion, 25867, "Update subfield descriptions for 952\$a and 952\$b");
}