Browse Source

Bug 22721: Remove frameworkcode parameter in GetMarcFromKohaField calls

Test plan:
Run tests, at least:
    t/db_dependent/Biblio.t
    t/db_dependent/Biblio/TransformHtmlToMarc.t
    t/db_dependent/Charset.t
    t/db_dependent/Circulation/GetTopIssues.t
    t/db_dependent/Filter_MARC_ViewPolicy.t
    t/db_dependent/ImportBatch.t
    t/db_dependent/Items.t
    t/db_dependent/Items/AutomaticItemModificationByAge.t
    t/db_dependent/Items/GetItemsForInventory.t
    t/db_dependent/Koha/Filter/EmbedItemsAvailability.t
    t/db_dependent/Serials.t
    t/db_dependent/XISBN.t
    t/db_dependent/FrameworkPlugin.t

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Bouzid Fergani <bouzid.fergani@inlibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
remotes/origin/19.11.x
Josef Moravec 2 years ago
committed by Martin Renvoize
parent
commit
68eeefa07e
Signed by: martin.renvoize GPG Key ID: 422B469130441A0F
  1. 4
      C4/Acquisition.pm
  2. 14
      C4/Biblio.pm
  3. 2
      C4/Charset.pm
  4. 8
      C4/ImportBatch.pm
  5. 10
      C4/Items.pm
  6. 2
      C4/Labels/Label.pm
  7. 3
      C4/Matcher.pm
  8. 8
      C4/Search.pm
  9. 2
      C4/Serials.pm
  10. 2
      Koha/Exporter/Record.pm
  11. 2
      Koha/Filter/MARC/EmbedItemsAvailability.pm
  12. 2
      Koha/Filter/MARC/EmbedSeeFromHeadings.pm
  13. 1
      Koha/FrameworkPlugin.pm
  14. 2
      Koha/SearchEngine/Search.pm
  15. 2
      acqui/addorderiso2709.pl
  16. 2
      acqui/finishreceive.pl
  17. 8
      acqui/neworderempty.pl
  18. 2
      catalogue/MARCdetail.pl
  19. 20
      cataloguing/addbiblio.pl
  20. 20
      cataloguing/additem.pl
  21. 5
      cataloguing/value_builder/barcode.pl
  22. 4
      cataloguing/value_builder/barcode_manual.pl
  23. 2
      circ/branchoverdues.pl
  24. 2
      misc/batchImportMARCWithBiblionumbers.pl
  25. 2
      misc/batchRebuildBiblioTables.pl
  26. 2
      misc/batchRebuildItemsTables.pl
  27. 4
      misc/migration_tools/22_to_30/missing090field.pl
  28. 4
      misc/migration_tools/bulkmarcimport.pl
  29. 6
      misc/migration_tools/rebuild_zebra.pl
  30. 6
      opac/opac-MARCdetail.pl
  31. 8
      serials/serials-edit.pl
  32. 2
      svc/bib
  33. 2
      svc/new_bib
  34. 2
      t/db_dependent/Biblio.t
  35. 2
      t/db_dependent/Biblio/TransformHtmlToMarc.t
  36. 2
      t/db_dependent/Charset.t
  37. 4
      t/db_dependent/Circulation/GetTopIssues.t
  38. 6
      t/db_dependent/Filter_MARC_ViewPolicy.t
  39. 2
      t/db_dependent/ImportBatch.t
  40. 4
      t/db_dependent/Items.t
  41. 2
      t/db_dependent/Items/AutomaticItemModificationByAge.t
  42. 2
      t/db_dependent/Items/GetItemsForInventory.t
  43. 4
      t/db_dependent/Koha/Filter/EmbedItemsAvailability.t
  44. 4
      t/db_dependent/Serials.t
  45. 4
      t/db_dependent/XISBN.t
  46. 8
      tools/batchMod.pl

4
C4/Acquisition.pm

@ -1675,7 +1675,7 @@ sub CancelReceipt {
for my $in ( @itemnumbers ) {
my $item = Koha::Items->find( $in ); # FIXME We do not need that, we already have Koha::Items from $order_obj->items
my $biblio = $item->biblio;
my ( $itemfield ) = GetMarcFromKohaField( 'items.itemnumber', $biblio->frameworkcode );
my ( $itemfield ) = GetMarcFromKohaField( 'items.itemnumber' );
my $item_marc = C4::Items::GetMarcItem( $biblio->biblionumber, $in );
for my $affect ( @affects ) {
my ( $sf, $v ) = split q{=}, $affect, 2;
@ -3239,7 +3239,7 @@ sub FillWithDefaultValues {
my $tagslib = C4::Biblio::GetMarcStructure( 1, 'ACQ', { unsafe => 1 } );
if ($tagslib) {
my ($itemfield) =
C4::Biblio::GetMarcFromKohaField( 'items.itemnumber', '' );
C4::Biblio::GetMarcFromKohaField( 'items.itemnumber' );
for my $tag ( sort keys %$tagslib ) {
next unless $tag;
next if $tag == $itemfield;

14
C4/Biblio.pm

@ -345,7 +345,7 @@ sub _strip_item_fields {
my $record = shift;
my $frameworkcode = shift;
# get the items before and append them to the biblio before updating the record, atm we just have the biblio
my ( $itemtag, $itemsubfield ) = GetMarcFromKohaField( "items.itemnumber", $frameworkcode );
my ( $itemtag, $itemsubfield ) = GetMarcFromKohaField( "items.itemnumber" );
# delete any item fields from incoming record to avoid
# duplication or incorrect data - use AddItem() or ModItem()
@ -738,7 +738,7 @@ sub GetISBDView {
my $sysprefname = $template eq 'opac' ? 'opacisbd' : 'isbd';
my $framework = $params->{framework};
my $itemtype = $framework;
my ( $holdingbrtagf, $holdingbrtagsubf ) = &GetMarcFromKohaField( "items.holdingbranch", $itemtype );
my ( $holdingbrtagf, $holdingbrtagsubf ) = &GetMarcFromKohaField( "items.holdingbranch" );
my $tagslib = GetMarcStructure( 1, $itemtype, { unsafe => 1 } );
my $ISBD = C4::Context->preference($sysprefname);
@ -2654,7 +2654,7 @@ sub EmbedItemsInMarcBiblio {
my $dbh = C4::Context->dbh;
my $sth = $dbh->prepare("SELECT itemnumber FROM items WHERE biblionumber = ?");
$sth->execute($biblionumber);
my ( $itemtag, $itemsubfield ) = GetMarcFromKohaField( "items.itemnumber", $frameworkcode );
my ( $itemtag, $itemsubfield ) = GetMarcFromKohaField( "items.itemnumber" );
my @item_fields; # Array holding the actual MARC data for items to be included.
my @items; # Array holding items which are both in the list (sitenumbers)
@ -2706,9 +2706,9 @@ the MARC XML.
sub _koha_marc_update_bib_ids {
my ( $record, $frameworkcode, $biblionumber, $biblioitemnumber ) = @_;
my ( $biblio_tag, $biblio_subfield ) = GetMarcFromKohaField( "biblio.biblionumber", $frameworkcode );
my ( $biblio_tag, $biblio_subfield ) = GetMarcFromKohaField( "biblio.biblionumber" );
die qq{No biblionumber tag for framework "$frameworkcode"} unless $biblio_tag;
my ( $biblioitem_tag, $biblioitem_subfield ) = GetMarcFromKohaField( "biblioitems.biblioitemnumber", $frameworkcode );
my ( $biblioitem_tag, $biblioitem_subfield ) = GetMarcFromKohaField( "biblioitems.biblioitemnumber" );
die qq{No biblioitemnumber tag for framework "$frameworkcode"} unless $biblioitem_tag;
if ( $biblio_tag < 10 ) {
@ -2737,7 +2737,7 @@ sub _koha_marc_update_biblioitem_cn_sort {
my $biblioitem = shift;
my $frameworkcode = shift;
my ( $biblioitem_tag, $biblioitem_subfield ) = GetMarcFromKohaField( "biblioitems.cn_sort", $frameworkcode );
my ( $biblioitem_tag, $biblioitem_subfield ) = GetMarcFromKohaField( "biblioitems.cn_sort" );
return unless $biblioitem_tag;
my ($cn_sort) = GetClassSort( $biblioitem->{'biblioitems.cn_source'}, $biblioitem->{'cn_class'}, $biblioitem->{'cn_item'} );
@ -3375,7 +3375,7 @@ sub UpdateTotalIssues {
return;
}
my $biblioitem = $biblio->biblioitem;
my ($totalissuestag, $totalissuessubfield) = GetMarcFromKohaField('biblioitems.totalissues', $biblio->frameworkcode);
my ($totalissuestag, $totalissuessubfield) = GetMarcFromKohaField( 'biblioitems.totalissues' );
unless ($totalissuestag) {
return 1; # There is nothing to do
}

2
C4/Charset.pm

@ -440,7 +440,7 @@ sub SanitizeRecord {
my $record_modified = 0;
my $frameworkcode = C4::Biblio::GetFrameworkCode($biblionumber);
my ( $url_field, $url_subfield ) =
C4::Biblio::GetMarcFromKohaField( 'biblioitems.url', $frameworkcode );
C4::Biblio::GetMarcFromKohaField( 'biblioitems.url' );
foreach my $field ( $record->fields() ) {
if ( $field->is_control_field() ) {
my $value = $field->data();

8
C4/ImportBatch.pm

@ -195,7 +195,7 @@ sub GetRecordFromImportBiblio {
sub EmbedItemsInImportBiblio {
my ( $record, $import_record_id ) = @_;
my ( $itemtag, $itemsubfield ) = GetMarcFromKohaField("items.itemnumber", '');
my ( $itemtag, $itemsubfield ) = GetMarcFromKohaField( "items.itemnumber" );
my $dbh = C4::Context->dbh;
my $import_items = $dbh->selectall_arrayref(q|
SELECT import_items.marcxml
@ -457,7 +457,7 @@ sub AddItemsToImportBiblio {
my @import_items_ids = ();
my $dbh = C4::Context->dbh;
my ($item_tag,$item_subfield) = &GetMarcFromKohaField("items.itemnumber",'');
my ($item_tag,$item_subfield) = &GetMarcFromKohaField( "items.itemnumber" );
foreach my $item_field ($marc_record->field($item_tag)) {
my $item_marc = MARC::Record->new();
$item_marc->leader("00000 a "); # must set Leader/09 to 'a'
@ -616,7 +616,7 @@ sub BatchCommitRecords {
if ($record_type eq 'biblio') {
# remove any item tags - rely on BatchCommitItems
($item_tag,$item_subfield) = &GetMarcFromKohaField("items.itemnumber",'');
($item_tag,$item_subfield) = &GetMarcFromKohaField( "items.itemnumber" );
foreach my $item_field ($marc_record->field($item_tag)) {
$marc_record->delete_field($item_field);
}
@ -741,7 +741,7 @@ sub BatchCommitItems {
my $item_marc = MARC::Record->new_from_xml( StripNonXmlChars( $row->{'marcxml'} ), 'UTF-8', $row->{'encoding'} );
# Delete date_due subfield as to not accidentally delete item checkout due dates
my ( $MARCfield, $MARCsubfield ) = GetMarcFromKohaField( 'items.onloan', GetFrameworkCode($biblionumber) );
my ( $MARCfield, $MARCsubfield ) = GetMarcFromKohaField( 'items.onloan' );
$item_marc->field($MARCfield)->delete_subfield( code => $MARCsubfield );
my $item = TransformMarcToKoha( $item_marc );

10
C4/Items.pm

@ -157,7 +157,7 @@ sub AddItemFromMarc {
# parse item hash from MARC
my $frameworkcode = C4::Biblio::GetFrameworkCode($biblionumber);
my ( $itemtag, $itemsubfield ) = C4::Biblio::GetMarcFromKohaField( "items.itemnumber", $frameworkcode );
my ( $itemtag, $itemsubfield ) = C4::Biblio::GetMarcFromKohaField( "items.itemnumber" );
my $localitemmarc = MARC::Record->new;
$localitemmarc->append_fields( $source_item_marc->field($itemtag) );
@ -287,7 +287,7 @@ sub AddItemBatchFromMarc {
$record = $record->clone();
# loop through the item tags and start creating items
my @bad_item_fields = ();
my ($itemtag, $itemsubfield) = C4::Biblio::GetMarcFromKohaField("items.itemnumber",'');
my ($itemtag, $itemsubfield) = C4::Biblio::GetMarcFromKohaField( "items.itemnumber" );
my $item_sequence_num = 0;
ITEMFIELD: foreach my $item_field ($record->field($itemtag)) {
$item_sequence_num++;
@ -420,7 +420,7 @@ sub ModItemFromMarc {
my $itemnumber = shift;
my $frameworkcode = C4::Biblio::GetFrameworkCode($biblionumber);
my ( $itemtag, $itemsubfield ) = C4::Biblio::GetMarcFromKohaField( "items.itemnumber", $frameworkcode );
my ( $itemtag, $itemsubfield ) = C4::Biblio::GetMarcFromKohaField( "items.itemnumber" );
my $localitemmarc = MARC::Record->new;
$localitemmarc->append_fields( $item_marc->field($itemtag) );
@ -1916,7 +1916,7 @@ sub _marc_from_item_hash {
my $item_marc = MARC::Record->new();
foreach my $item_field ( keys %{$mungeditem} ) {
my ( $tag, $subfield ) = C4::Biblio::GetMarcFromKohaField( $item_field, $frameworkcode );
my ( $tag, $subfield ) = C4::Biblio::GetMarcFromKohaField( $item_field );
next unless defined $tag and defined $subfield; # skip if not mapped to MARC field
my @values = split(/\s?\|\s?/, $mungeditem->{$item_field}, -1);
foreach my $value (@values){
@ -2338,7 +2338,7 @@ sub PrepareItemrecordDisplay {
my $dbh = C4::Context->dbh;
$frameworkcode = C4::Biblio::GetFrameworkCode($bibnum) if $bibnum;
my ( $itemtagfield, $itemtagsubfield ) = C4::Biblio::GetMarcFromKohaField( "items.itemnumber", $frameworkcode );
my ( $itemtagfield, $itemtagsubfield ) = C4::Biblio::GetMarcFromKohaField( "items.itemnumber" );
# Note: $tagslib obtained from GetMarcStructure() in 'unsafe' mode is
# a shared data structure. No plugin (including custom ones) should change

2
C4/Labels/Label.pm

@ -159,7 +159,7 @@ sub _get_barcode_data {
elsif ( $f =~ /^([0-9a-z]{3})(\w)(\W?).*?/ ) {
my ($field,$subf,$ws) = ($1,$2,$3);
my $subf_data;
my ($itemtag, $itemsubfieldcode) = &GetMarcFromKohaField("items.itemnumber",'');
my ($itemtag, $itemsubfieldcode) = &GetMarcFromKohaField( "items.itemnumber" );
my @marcfield = $record->field($field);
if(@marcfield) {
if($field eq $itemtag) { # item-level data, we need to get the right item.

3
C4/Matcher.pm

@ -621,7 +621,6 @@ sub get_matches {
my ($source_record, $max_matches) = @_;
my $matches = {};
my $marcframework_used = ''; # use the default framework
my $QParser;
$QParser = C4::Context->queryparser if (C4::Context->preference('UseQueryParser'));
@ -677,7 +676,7 @@ sub get_matches {
else {
foreach my $matched ( @{$searchresults} ) {
my $target_record = C4::Search::new_record_from_zebra( 'biblioserver', $matched );
my ( $biblionumber_tag, $biblionumber_subfield ) = C4::Biblio::GetMarcFromKohaField( "biblio.biblionumber", $marcframework_used );
my ( $biblionumber_tag, $biblionumber_subfield ) = C4::Biblio::GetMarcFromKohaField( "biblio.biblionumber" );
my $id = ( $biblionumber_tag > 10 ) ?
$target_record->field($biblionumber_tag)->subfield($biblionumber_subfield) :
$target_record->field($biblionumber_tag)->data();

8
C4/Search.pm

@ -1864,14 +1864,14 @@ sub searchResults {
my %itemtypes = map { $_->{itemtype} => $_ } @{ $itemtypes->unblessed };
#search item field code
my ($itemtag, undef) = &GetMarcFromKohaField( "items.itemnumber", "" );
my ($itemtag, undef) = &GetMarcFromKohaField( "items.itemnumber" );
## find column names of items related to MARC
my %subfieldstosearch;
my @columns = Koha::Database->new()->schema()->resultset('Item')->result_source->columns;
for my $column ( @columns ) {
my ( $tagfield, $tagsubfield ) =
&GetMarcFromKohaField( "items." . $column, "" );
&GetMarcFromKohaField( "items." . $column );
if ( defined $tagsubfield ) {
$subfieldstosearch{$column} = $tagsubfield;
}
@ -1888,7 +1888,7 @@ sub searchResults {
my $marcflavour = C4::Context->preference("marcflavour");
# We get the biblionumber position in MARC
my ($bibliotag,$bibliosubf)=GetMarcFromKohaField('biblio.biblionumber','');
my ($bibliotag,$bibliosubf)=GetMarcFromKohaField( 'biblio.biblionumber' );
# set stuff for XSLT processing here once, not later again for every record we retrieved
my $xslfile;
@ -2017,7 +2017,7 @@ sub searchResults {
my $hostbiblio = GetMarcBiblio({
biblionumber => $hostbiblionumber,
embed_items => 1 });
my ($itemfield, undef) = GetMarcFromKohaField( 'items.itemnumber', GetFrameworkCode($hostbiblionumber) );
my ($itemfield, undef) = GetMarcFromKohaField( 'items.itemnumber' );
if( $hostbiblio ) {
my @hostitems = $hostbiblio->field($itemfield);
foreach my $hostitem (@hostitems){

2
C4/Serials.pm

@ -1457,7 +1457,7 @@ sub NewSubscription {
my $biblio = Koha::Biblios->find( $biblionumber );
if ( $biblio and !$biblio->serial ) {
my $record = GetMarcBiblio({ biblionumber => $biblionumber });
my ( $tag, $subf ) = GetMarcFromKohaField( 'biblio.serial', $biblio->frameworkcode );
my ( $tag, $subf ) = GetMarcFromKohaField( 'biblio.serial' );
if ($tag) {
eval { $record->field($tag)->update( $subf => 1 ); };
}

2
Koha/Exporter/Record.pm

@ -131,7 +131,7 @@ sub _get_biblio_for_export {
item_numbers => $itemnumbers });
if ($only_export_items_for_branches && @$only_export_items_for_branches) {
my %export_items_for_branches = map { $_ => 1 } @$only_export_items_for_branches;
my ( $homebranchfield, $homebranchsubfield ) = GetMarcFromKohaField( 'items.homebranch', '' ); # Should be GetFrameworkCode( $biblionumber )?
my ( $homebranchfield, $homebranchsubfield ) = GetMarcFromKohaField( 'items.homebranch' );
for my $itemfield ( $record->field($homebranchfield) ) {
my $homebranch = $itemfield->subfield($homebranchsubfield);

2
Koha/Filter/MARC/EmbedItemsAvailability.pm

@ -71,7 +71,7 @@ sub _processrecord {
my $record = shift;
my ($biblionumber_field, $biblionumber_subfield) = GetMarcFromKohaField("biblio.biblionumber", '');
my ($biblionumber_field, $biblionumber_subfield) = GetMarcFromKohaField( "biblio.biblionumber" );
my $biblionumber = ( $biblionumber_field > 9 )
? $record->field($biblionumber_field)->subfield($biblionumber_subfield)
: $record->field($biblionumber_field)->data();

2
Koha/Filter/MARC/EmbedSeeFromHeadings.pm

@ -72,7 +72,7 @@ sub filter {
sub _processrecord {
my $record = shift;
my ($item_tag) = GetMarcFromKohaField("items.itemnumber", '');
my ($item_tag) = GetMarcFromKohaField( "items.itemnumber" );
$item_tag ||= '';
foreach my $field ( $record->fields() ) {

1
Koha/FrameworkPlugin.pm

@ -115,7 +115,6 @@ use Modern::Perl;
use base qw(Class::Accessor);
use C4::Context;
use C4::Biblio qw/GetMarcFromKohaField/;
__PACKAGE__->mk_ro_accessors( qw|
name path errstr javascript noclick

2
Koha/SearchEngine/Search.pm

@ -68,7 +68,7 @@ extract_biblionumber method of the specific search engine.
sub extract_biblionumber {
my ( $record ) = @_;
return if ref($record) ne 'MARC::Record';
my ( $biblionumbertagfield, $biblionumbertagsubfield ) = C4::Biblio::GetMarcFromKohaField( 'biblio.biblionumber', '' );
my ( $biblionumbertagfield, $biblionumbertagsubfield ) = C4::Biblio::GetMarcFromKohaField( 'biblio.biblionumber' );
if( $biblionumbertagfield < 10 ) {
my $controlfield = $record->field( $biblionumbertagfield );
return $controlfield ? $controlfield->data : undef;

2
acqui/addorderiso2709.pl

@ -182,7 +182,7 @@ if ($op eq ""){
my $bibitemnum;
# remove ISBN -
my ( $isbnfield, $isbnsubfield ) = GetMarcFromKohaField( 'biblioitems.isbn', '' );
my ( $isbnfield, $isbnsubfield ) = GetMarcFromKohaField( 'biblioitems.isbn' );
if ( $marcrecord->field($isbnfield) ) {
foreach my $field ( $marcrecord->field($isbnfield) ) {
foreach my $subfield ( $field->subfield($isbnsubfield) ) {

2
acqui/finishreceive.pl

@ -82,7 +82,7 @@ if ($quantityrec > $origquantityrec ) {
my @affects = split q{\|}, C4::Context->preference("AcqItemSetSubfieldsWhenReceived");
if ( @affects ) {
my $frameworkcode = GetFrameworkCode($biblionumber);
my ( $itemfield ) = GetMarcFromKohaField( 'items.itemnumber', $frameworkcode );
my ( $itemfield ) = GetMarcFromKohaField( 'items.itemnumber' );
for my $in ( @received_items ) {
my $item = C4::Items::GetMarcItem( $biblionumber, $in );
for my $affect ( @affects ) {

8
acqui/neworderempty.pl

@ -177,7 +177,7 @@ if ( $ordernumber eq '' and defined $params->{'breedingid'}){
my ( @order_user_ids, @order_users, @catalog_details );
our $tagslib = GetMarcStructure(1, 'ACQ', { unsafe => 1 } );
my ( $itemnumber_tag, $itemnumber_subtag ) = GetMarcFromKohaField( 'items.itemnumber', 'ACQ' );
my ( $itemnumber_tag, $itemnumber_subtag ) = GetMarcFromKohaField( 'items.itemnumber' );
if ( not $ordernumber ) { # create order
$new = 'yes';
@ -388,7 +388,7 @@ if ( defined $from_subscriptionid ) {
}
# Find the items.barcode subfield for barcode validations
my (undef, $barcode_subfield) = GetMarcFromKohaField('items.barcode', '');
my (undef, $barcode_subfield) = GetMarcFromKohaField( 'items.barcode' );
# fill template
$template->param(
@ -491,7 +491,7 @@ sub MARCfindbreeding {
# remove the - in isbn, koha store isbn without any -
if ($marc) {
my $record = MARC::Record->new_from_usmarc($marc);
my ($isbnfield,$isbnsubfield) = GetMarcFromKohaField('biblioitems.isbn','');
my ($isbnfield,$isbnsubfield) = GetMarcFromKohaField( 'biblioitems.isbn' );
if ( $record->field($isbnfield) ) {
foreach my $field ( $record->field($isbnfield) ) {
foreach my $subfield ( $field->subfield($isbnsubfield) ) {
@ -523,7 +523,7 @@ sub MARCfindbreeding {
if ( C4::Context->preference("z3950NormalizeAuthor")
and C4::Context->preference("z3950AuthorAuthFields") )
{
my ( $tag, $subfield ) = GetMarcFromKohaField("biblio.author", '');
my ( $tag, $subfield ) = GetMarcFromKohaField( "biblio.author" );
my $auth_fields =
C4::Context->preference("z3950AuthorAuthFields");

2
catalogue/MARCdetail.pl

@ -280,7 +280,7 @@ foreach my $field (@fields) {
push @item_loop, $item if $item;
}
my ($holdingbrtagf,$holdingbrtagsubf) = &GetMarcFromKohaField("items.holdingbranch",$frameworkcode);
my ($holdingbrtagf,$holdingbrtagsubf) = &GetMarcFromKohaField( "items.holdingbranch" );
@item_loop = sort {$a->{$holdingbrtagsubf} cmp $b->{$holdingbrtagsubf}} @item_loop;
@item_subfield_codes = uniq @item_subfield_codes;

20
cataloguing/addbiblio.pl

@ -72,7 +72,7 @@ sub MARCfindbreeding {
# remove the - in isbn, koha store isbn without any -
if ($marc) {
my $record = MARC::Record->new_from_usmarc($marc);
my ($isbnfield,$isbnsubfield) = GetMarcFromKohaField('biblioitems.isbn','');
my ($isbnfield,$isbnsubfield) = GetMarcFromKohaField( 'biblioitems.isbn' );
if ( $record->field($isbnfield) ) {
foreach my $field ( $record->field($isbnfield) ) {
foreach my $subfield ( $field->subfield($isbnsubfield) ) {
@ -105,7 +105,7 @@ sub MARCfindbreeding {
and C4::Context->preference("z3950AuthorAuthFields")
and C4::Context->preference("marcflavour") eq 'UNIMARC' )
{
my ( $tag, $subfield ) = GetMarcFromKohaField("biblio.author", '');
my ( $tag, $subfield ) = GetMarcFromKohaField( "biblio.author" );
my $auth_fields =
C4::Context->preference("z3950AuthorAuthFields");
@ -249,11 +249,11 @@ sub CreateKey {
sub GetMandatoryFieldZ3950 {
my $frameworkcode = shift;
my @isbn = GetMarcFromKohaField('biblioitems.isbn',$frameworkcode);
my @title = GetMarcFromKohaField('biblio.title',$frameworkcode);
my @author = GetMarcFromKohaField('biblio.author',$frameworkcode);
my @issn = GetMarcFromKohaField('biblioitems.issn',$frameworkcode);
my @lccn = GetMarcFromKohaField('biblioitems.lccn',$frameworkcode);
my @isbn = GetMarcFromKohaField( 'biblioitems.isbn' );
my @title = GetMarcFromKohaField( 'biblio.title' );
my @author = GetMarcFromKohaField( 'biblio.author' );
my @issn = GetMarcFromKohaField( 'biblioitems.issn' );
my @lccn = GetMarcFromKohaField( 'biblioitems.lccn' );
return {
$isbn[0].$isbn[1] => 'isbn',
@ -808,10 +808,10 @@ if ($biblionumber) {
# if it's a modif, retrieve bibli and biblioitem numbers for the future modification of old-DB.
( $biblionumbertagfield, $biblionumbertagsubfield ) =
&GetMarcFromKohaField( "biblio.biblionumber", $frameworkcode );
&GetMarcFromKohaField( "biblio.biblionumber" );
( $biblioitemnumtagfield, $biblioitemnumtagsubfield ) =
&GetMarcFromKohaField( "biblioitems.biblioitemnumber", $frameworkcode );
&GetMarcFromKohaField( "biblioitems.biblioitemnumber" );
# search biblioitems value
my $sth = $dbh->prepare("select biblioitemnumber from biblioitems where biblionumber=?");
$sth->execute($biblionumber);

20
cataloguing/additem.pl

@ -95,7 +95,7 @@ sub set_item_default_location {
# NOTE: 'incremental' is the ONLY autoBarcode option available to those not using javascript
sub _increment_barcode {
my ($record, $frameworkcode) = @_;
my ($tagfield,$tagsubfield) = &GetMarcFromKohaField("items.barcode",$frameworkcode);
my ($tagfield,$tagsubfield) = &GetMarcFromKohaField( "items.barcode" );
unless ($record->field($tagfield)->subfield($tagsubfield)) {
my $sth_barcode = $dbh->prepare("select max(abs(barcode)) from items");
$sth_barcode->execute;
@ -353,7 +353,7 @@ sub removeFieldsForPrefill {
my $item = shift;
# Getting item tag
my ($tag, $subtag) = GetMarcFromKohaField("items.barcode", '');
my ($tag, $subtag) = GetMarcFromKohaField( "items.barcode" );
# Getting list of subfields to keep
my $subfieldsToUseWhenPrefill = C4::Context->preference('SubfieldsToUseWhenPrefill');
@ -526,7 +526,7 @@ if ($op eq "additem") {
}
else {
# we have to clear the barcode field in the duplicate item record to make way for the new one generated by the javascript plugin
my ($tagfield,$tagsubfield) = &GetMarcFromKohaField("items.barcode",$frameworkcode);
my ($tagfield,$tagsubfield) = &GetMarcFromKohaField( "items.barcode" );
my $fieldItem = $itemrecord->field($tagfield);
$itemrecord->delete_field($fieldItem);
$fieldItem->delete_subfields($tagsubfield);
@ -542,8 +542,8 @@ if ($op eq "additem") {
my $barcodeobj = C4::Barcodes->new;
my $copynumber = $addedolditem->{'copynumber'};
my $oldbarcode = $addedolditem->{'barcode'};
my ($tagfield,$tagsubfield) = &GetMarcFromKohaField("items.barcode",$frameworkcode);
my ($copytagfield,$copytagsubfield) = &GetMarcFromKohaField("items.copynumber",$frameworkcode);
my ($tagfield,$tagsubfield) = &GetMarcFromKohaField( "items.barcode" );
my ($copytagfield,$copytagsubfield) = &GetMarcFromKohaField( "items.copynumber" );
# If there is a barcode and we can't find their new values, we can't add multiple copies
my $testbarcode;
@ -629,7 +629,7 @@ if ($op eq "additem") {
}
else {
# we have to clear the barcode field in the duplicate item record to make way for the new one generated by the javascript plugin
my ($tagfield,$tagsubfield) = &GetMarcFromKohaField("items.barcode",$frameworkcode);
my ($tagfield,$tagsubfield) = &GetMarcFromKohaField( "items.barcode" );
my $fieldItem = $itemrecord->field($tagfield);
$itemrecord->delete_field($fieldItem);
$fieldItem->delete_subfields($tagsubfield);
@ -748,8 +748,8 @@ my $temp = GetMarcBiblio({ biblionumber => $biblionumber });
my %witness; #---- stores the list of subfields used at least once, with the "meaning" of the code
my @big_array;
#---- finds where items.itemnumber is stored
my ( $itemtagfield, $itemtagsubfield) = &GetMarcFromKohaField("items.itemnumber", $frameworkcode);
my ($branchtagfield, $branchtagsubfield) = &GetMarcFromKohaField("items.homebranch", $frameworkcode);
my ( $itemtagfield, $itemtagsubfield) = &GetMarcFromKohaField( "items.itemnumber" );
my ($branchtagfield, $branchtagsubfield) = &GetMarcFromKohaField( "items.homebranch" );
C4::Biblio::EmbedItemsInMarcBiblio({
marc_record => $temp,
biblionumber => $biblionumber });
@ -771,7 +771,7 @@ if ( C4::Context->preference('EasyAnalyticalRecords') ) {
biblionumber => $hostbiblionumber,
embed_items => 1 });
if ($hostrecord) {
my ($itemfield, undef) = GetMarcFromKohaField( 'items.itemnumber', GetFrameworkCode($hostbiblionumber) );
my ($itemfield, undef) = GetMarcFromKohaField( 'items.itemnumber' );
foreach my $hostitem ($hostrecord->field($itemfield)){
if ($hostitem->subfield('9') eq $hostfield->subfield('9')){
push (@fields, $hostitem);
@ -831,7 +831,7 @@ foreach my $field (@fields) {
}
}
my ($holdingbrtagf,$holdingbrtagsubf) = &GetMarcFromKohaField("items.holdingbranch",$frameworkcode);
my ($holdingbrtagf,$holdingbrtagsubf) = &GetMarcFromKohaField( "items.holdingbranch" );
@big_array = sort {$a->{$holdingbrtagsubf} cmp $b->{$holdingbrtagsubf}} @big_array;
# now, construct template !

5
cataloguing/value_builder/barcode.pl

@ -24,6 +24,7 @@ use Modern::Perl;
use C4::Context;
use C4::Barcodes::ValueBuilder;
use C4::Biblio qw/GetMarcFromKohaField/;
use Koha::DateUtils;
use Algorithm::CheckDigits;
@ -37,8 +38,8 @@ my $builder = sub {
# find today's date
($args{year}, $args{mon}, $args{day}) = split('-', output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 }));
($args{tag},$args{subfield}) = GetMarcFromKohaField("items.barcode", '');
($args{loctag},$args{locsubfield}) = GetMarcFromKohaField("items.homebranch", '');
($args{tag},$args{subfield}) = GetMarcFromKohaField( "items.barcode" );
($args{loctag},$args{locsubfield}) = GetMarcFromKohaField( "items.homebranch" );
my $nextnum;
my $scr;

4
cataloguing/value_builder/barcode_manual.pl

@ -38,8 +38,8 @@ my $builder = sub {
# find today's date
($args{year}, $args{mon}, $args{day}) = split('-', output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 }));
($args{tag},$args{subfield}) = GetMarcFromKohaField("items.barcode", '');
($args{loctag},$args{locsubfield}) = GetMarcFromKohaField("items.homebranch", '');
($args{tag},$args{subfield}) = GetMarcFromKohaField( "items.barcode" );
($args{loctag},$args{locsubfield}) = GetMarcFromKohaField( "items.homebranch" );
my $nextnum;
my $scr;

2
circ/branchoverdues.pl

@ -66,7 +66,7 @@ my @overduesloop;
my @getoverdues = GetOverduesForBranch( $default, $location );
$debug and warn "HERE : $default / $location" . Dumper(@getoverdues);
# search for location authorised value
my ($tag,$subfield) = GetMarcFromKohaField('items.location','');
my ($tag,$subfield) = GetMarcFromKohaField( 'items.location' );
my $tagslib = &GetMarcStructure(1,'');
if ($tagslib->{$tag}->{$subfield}->{authorised_value}) {
my $values= GetAuthorisedValues($tagslib->{$tag}->{$subfield}->{authorised_value});

2
misc/batchImportMARCWithBiblionumbers.pl

@ -53,7 +53,7 @@ my $fh = IO::File->new($input_marc_file); # don't let MARC::Batch open the file,
my $batch = MARC::Batch->new( 'USMARC', $fh );
$batch->warnings_off();
$batch->strict_off();
my ($tagfield,$biblionumtagsubfield) = &GetMarcFromKohaField("biblio.biblionumber","");
my ($tagfield,$biblionumtagsubfield) = &GetMarcFromKohaField( "biblio.biblionumber" );
my $i=0;
while ( my $record = $batch->next() ) {

2
misc/batchRebuildBiblioTables.pl

@ -53,7 +53,7 @@ $|=1; # flushes output
$starttime = gettimeofday;
#1st of all, find item MARC tag.
my ($tagfield,$tagsubfield) = &GetMarcFromKohaField("items.itemnumber",'');
my ($tagfield,$tagsubfield) = &GetMarcFromKohaField( "items.itemnumber" );
# $dbh->do("lock tables biblio write, biblioitems write, items write, marc_biblio write, marc_subfield_table write, marc_blob_subfield write, marc_word write, marc_subfield_structure write");
my $sth = $dbh->prepare("SELECT biblionumber FROM biblio");
$sth->execute;

2
misc/batchRebuildItemsTables.pl

@ -57,7 +57,7 @@ my $mergelimit = C4::Context->preference('AuthorityMergeLimit');
$dbh->do("UPDATE systempreferences SET value=0 WHERE variable='CataloguingLog'");
$dbh->do("UPDATE systempreferences SET value=0 where variable='AuthorityMergeLimit'");
$dbh->commit() unless $test_parameter;
my ( $itemfield, $itemnumbersubfield ) = &GetMarcFromKohaField( "items.itemnumber", '' );
my ( $itemfield, $itemnumbersubfield ) = &GetMarcFromKohaField( "items.itemnumber" );
#dbh query init
my $query =

4
misc/migration_tools/22_to_30/missing090field.pl

@ -37,8 +37,8 @@ sub MARCmodbiblionumber{
return unless $record;
my ($tagfield,$biblionumtagsubfield) = &GetMarcFromKohaField("biblio.biblionumber","");
my ($tagfield2,$biblioitemtagsubfield) = &GetMarcFromKohaField("biblio.biblioitemnumber","");
my ($tagfield,$biblionumtagsubfield) = &GetMarcFromKohaField( "biblio.biblionumber" );
my ($tagfield2,$biblioitemtagsubfield) = &GetMarcFromKohaField( "biblio.biblioitemnumber" );
my $update=0;
if (defined $record) {

4
misc/migration_tools/bulkmarcimport.pl

@ -240,7 +240,7 @@ if ($authorities){
}
else {
( $tagid, $subfieldid ) =
GetMarcFromKohaField( "biblio.biblionumber", $framework );
GetMarcFromKohaField( "biblio.biblionumber" );
$tagid||="001";
}
@ -506,7 +506,7 @@ RECORD: while ( ) {
}
if ($dedup_barcode && grep { exists $_->{error_code} && $_->{error_code} eq 'duplicate_barcode' } @$errors_ref) {
# Find the record called 'barcode'
my ($tag, $sub) = C4::Biblio::GetMarcFromKohaField('items.barcode', $framework);
my ($tag, $sub) = C4::Biblio::GetMarcFromKohaField( 'items.barcode' );
# Now remove any items that didn't have a duplicate_barcode error,
# erase the barcodes on items that did, and re-add those items.
my %dupes;

6
misc/migration_tools/rebuild_zebra.pl

@ -171,8 +171,8 @@ my $authorityserverdir = C4::Context->zebraconfig('authorityserver')->{directory
my $kohadir = C4::Context->config('intranetdir');
my ($biblionumbertagfield,$biblionumbertagsubfield) = C4::Biblio::GetMarcFromKohaField("biblio.biblionumber","");
my ($biblioitemnumbertagfield,$biblioitemnumbertagsubfield) = C4::Biblio::GetMarcFromKohaField("biblioitems.biblioitemnumber","");
my ($biblionumbertagfield,$biblionumbertagsubfield) = C4::Biblio::GetMarcFromKohaField( "biblio.biblionumber" );
my ($biblioitemnumbertagfield,$biblioitemnumbertagsubfield) = C4::Biblio::GetMarcFromKohaField( "biblioitems.biblioitemnumber" );
my $marcxml_open = q{<?xml version="1.0" encoding="UTF-8"?>
<collection xmlns="http://www.loc.gov/MARC21/slim">
@ -495,7 +495,7 @@ sub export_marc_records_from_sth {
print {$fh} $marcxml_open;
my $i = 0;
my ( $itemtag, $itemsubfield ) = C4::Biblio::GetMarcFromKohaField("items.itemnumber",'');
my ( $itemtag, $itemsubfield ) = C4::Biblio::GetMarcFromKohaField( "items.itemnumber" );
while (my ($record_number) = $sth->fetchrow_array) {
print "." if ( $verbose_logging );
print "\r$i" unless ($i++ %100 or !$verbose_logging);

6
opac/opac-MARCdetail.pl

@ -105,7 +105,7 @@ my @all_items = GetItemsInfo($biblionumber);
my $biblio = Koha::Biblios->find( $biblionumber );
my $framework = $biblio ? $biblio->frameworkcode : q{};
my $tagslib = &GetMarcStructure( 0, $framework );
my ($tag_itemnumber,$subtag_itemnumber) = &GetMarcFromKohaField('items.itemnumber',$framework);
my ($tag_itemnumber,$subtag_itemnumber) = &GetMarcFromKohaField( 'items.itemnumber' );
my @nonhiddenitems = $record->field($tag_itemnumber);
if (scalar @all_items >= 1 && scalar @nonhiddenitems == 0) {
print $query->redirect("/cgi-bin/koha/errors/404.pl");
@ -129,7 +129,7 @@ if(my $cart_list = $query->cookie("bib_list")){
}
}
my ($bt_tag,$bt_subtag) = GetMarcFromKohaField('biblio.title',$framework);
my ($bt_tag,$bt_subtag) = GetMarcFromKohaField( 'biblio.title' );
$template->param(
bibliotitle => $biblio->title,
) if $tagslib->{$bt_tag}->{$bt_subtag}->{hidden} <= 0 && # <=0 OPAC visible.
@ -307,7 +307,7 @@ foreach my $field (@fields) {
push @item_loop, $item if $item;
}
my ( $holdingbrtagf, $holdingbrtagsubf ) =
&GetMarcFromKohaField( "items.holdingbranch", $framework );
&GetMarcFromKohaField( "items.holdingbranch" );
@item_loop =
sort { ($a->{$holdingbrtagsubf}||'') cmp ($b->{$holdingbrtagsubf}||'') } @item_loop;

8
serials/serials-edit.pl

@ -340,13 +340,7 @@ if ( $op and $op eq 'serialchangestatus' ) {
#New Item
# if autoBarcode is set to 'incremental', calculate barcode...
my ( $barcodetagfield, $barcodetagsubfield ) =
GetMarcFromKohaField(
'items.barcode',
GetFrameworkCode(
$serialdatalist[0]->{'biblionumber'}
)
);
my ( $barcodetagfield, $barcodetagsubfield ) = GetMarcFromKohaField( 'items.barcode' );
if ( C4::Context->preference('autoBarcode') eq
'incremental' )
{

2
svc/bib

@ -98,7 +98,7 @@ sub update_bib {
} else {
my $fullrecord = $record->clone();
my ( $itemtag, $itemsubfield ) =
GetMarcFromKohaField( "items.itemnumber", '' );
GetMarcFromKohaField( "items.itemnumber" );
# delete any item tags
foreach my $field ( $record->field($itemtag) ) {

2
svc/new_bib

@ -70,7 +70,7 @@ sub add_bib {
# delete any item tags
my ( $itemtag, $itemsubfield ) =
GetMarcFromKohaField( "items.itemnumber", '' );
GetMarcFromKohaField( "items.itemnumber" );
foreach my $field ( $record->field($itemtag) ) {
$record->delete_field($field);
}

2
t/db_dependent/Biblio.t

@ -319,7 +319,7 @@ sub run_tests {
biblionumber => $biblionumber,
embed_items => 0 });
my $frameworkcode = GetFrameworkCode($biblionumber);
my ( $biblioitem_tag, $biblioitem_subfield ) = GetMarcFromKohaField( "biblioitems.biblioitemnumber", $frameworkcode );
my ( $biblioitem_tag, $biblioitem_subfield ) = GetMarcFromKohaField( "biblioitems.biblioitemnumber" );
die qq{No biblioitemnumber tag for framework "$frameworkcode"} unless $biblioitem_tag;
my $biblioitemnumbertotest;
if ( $biblioitem_tag < 10 ) {

2
t/db_dependent/Biblio/TransformHtmlToMarc.t

@ -7,7 +7,7 @@ use Test::More tests => 2;
use C4::Biblio;
my ( $biblionumbertagfield, $biblionumbertagsubfield ) = C4::Biblio::GetMarcFromKohaField( "biblio.biblionumber", '' );
my ( $biblionumbertagfield, $biblionumbertagsubfield ) = C4::Biblio::GetMarcFromKohaField( "biblio.biblionumber" );
subtest 'Biblio record' => sub {
plan tests => 10;
my $leader = '00203nam a2200097 4500';

2
t/db_dependent/Charset.t

@ -21,7 +21,7 @@ $dbh->do(qq|
INSERT INTO marc_subfield_structure(frameworkcode,kohafield,tagfield,tagsubfield)
VALUES ('$frameworkcode', 'biblioitems.url', '856', 'u')
|);
my ( $url_field, $url_subfield ) = C4::Biblio::GetMarcFromKohaField('biblioitems.url', $frameworkcode);
my ( $url_field, $url_subfield ) = C4::Biblio::GetMarcFromKohaField( 'biblioitems.url' );
my $title = q|My title & a word & another word|;
my $url = q|http://www.example.org/index.pl?arg1=val1&amp;arg2=val2|;

4
t/db_dependent/Circulation/GetTopIssues.t

@ -117,8 +117,8 @@ $schema->storage->txn_rollback();
sub create_biblio {
my ($title, $itemtype) = @_;
my ($title_tag, $title_subfield) = GetMarcFromKohaField('biblio.title', '');
my ($it_tag, $it_subfield) = GetMarcFromKohaField('biblioitems.itemtype', '');
my ($title_tag, $title_subfield) = GetMarcFromKohaField( 'biblio.title' );
my ($it_tag, $it_subfield) = GetMarcFromKohaField( 'biblioitems.itemtype' );
my $record = MARC::Record->new();
$record->append_fields(

6
t/db_dependent/Filter_MARC_ViewPolicy.t

@ -59,7 +59,7 @@ sub run_hiding_tests {
};
my ( $isbn_field, $isbn_subfield ) =
GetMarcFromKohaField( 'biblioitems.isbn', q{} );
GetMarcFromKohaField( 'biblioitems.isbn' );
my $update_sql = q{UPDATE marc_subfield_structure SET hidden=? };
my $sth = $dbh->prepare($update_sql);
foreach my $hidden_value (@valid_hidden_values) {
@ -170,9 +170,9 @@ sub run_hiding_tests {
sub create_marc_record {
my ( $title_field, $title_subfield ) =
GetMarcFromKohaField( 'biblio.title', q{} );
GetMarcFromKohaField( 'biblio.title' );
my ( $isbn_field, $isbn_subfield ) =
GetMarcFromKohaField( 'biblioitems.isbn', q{} );
GetMarcFromKohaField( 'biblioitems.isbn' );
my $isbn = '0590353403';
my $title = 'Foundation';
my $marc_record = MARC::Record->new;

2
t/db_dependent/ImportBatch.t

@ -86,7 +86,7 @@ my $record = MARC::Record->new;
my $original_record = MARC::Record->new;
$record->leader('03174nam a2200445 a 4500');
$original_record->leader('03174nam a2200445 a 4500');
my ($item_tag, $item_subfield) = C4::Biblio::GetMarcFromKohaField('items.itemnumber','');
my ($item_tag, $item_subfield) = C4::Biblio::GetMarcFromKohaField( 'items.itemnumber' );
my @fields = (
MARC::Field->new(
100, '1', ' ',

4
t/db_dependent/Items.t

@ -487,7 +487,7 @@ subtest 'SearchItems test' => sub {
ok($found, "item1 found");
my $frameworkcode = q||;
my ($itemfield) = GetMarcFromKohaField('items.itemnumber', $frameworkcode);
my ($itemfield) = GetMarcFromKohaField( 'items.itemnumber' );
# Create item subfield 'z' without link
$dbh->do('DELETE FROM marc_subfield_structure WHERE tagfield=? AND tagsubfield="z" AND frameworkcode=?', undef, $itemfield, $frameworkcode);
@ -640,7 +640,7 @@ subtest 'C4::Biblio::EmbedItemsInMarcBiblio' => sub {
t::lib::Mocks::mock_preference( 'OpacHiddenItems', '' );
my ($itemfield) =
C4::Biblio::GetMarcFromKohaField( 'items.itemnumber', '' );
C4::Biblio::GetMarcFromKohaField( 'items.itemnumber' );
my $record = C4::Biblio::GetMarcBiblio({ biblionumber => $biblio->biblionumber });
warning_is { C4::Biblio::EmbedItemsInMarcBiblio() }
{ carped => 'EmbedItemsInMarcBiblio: No MARC record passed' },

2
t/db_dependent/Items/AutomaticItemModificationByAge.t

@ -66,7 +66,7 @@ my ($item_bibnum, $item_bibitemnum, $itemnumber) = C4::Items::AddItem(
my $item = Koha::Items->find( $itemnumber );
is ( $item->new_status, 'new_value', q|AddItem insert the 'new_status' field| );
my ( $tagfield, undef ) = GetMarcFromKohaField('items.itemnumber', $frameworkcode);
my ( $tagfield, undef ) = GetMarcFromKohaField( 'items.itemnumber' );
my $marc_item = C4::Items::GetMarcItem( $biblionumber, $itemnumber );
is( $marc_item->subfield($tagfield, $new_tagfield), 'new_value', q|Koha mapping is correct|);

2
t/db_dependent/Items/GetItemsForInventory.t

@ -287,7 +287,7 @@ sub OldWay { # FIXME Do we really still need so much code to check results ??
# Auth values
foreach my $field (sort keys %$row) {
# If the koha field is mapped to a marc field
my ($f, $sf) = C4::Biblio::GetMarcFromKohaField("items.$field", $row->{'frameworkcode'});
my ($f, $sf) = C4::Biblio::GetMarcFromKohaField( "items.$field" );
if (defined($f) and defined($sf)) {
# We replace the code with it's description
my $avs;

4
t/db_dependent/Koha/Filter/EmbedItemsAvailability.t

@ -40,7 +40,7 @@ subtest 'EmbedItemsAvailability tests' => sub {
my $biblio = Test::MockModule->new('C4::Biblio');
$biblio->mock( 'GetMarcFromKohaField', sub {
my ( $kohafield, $frameworkcode ) = @_;
my ( $kohafield ) = @_;
if ( $kohafield eq 'biblio.biblionumber' ) {
if ( C4::Context->preference('marcflavour') eq 'UNIMARC' ) {
return ( '001', '@' );
@ -51,7 +51,7 @@ subtest 'EmbedItemsAvailability tests' => sub {
}
else {
my $func_ref = $biblio->original( 'GetMarcFromKohaField' );
&$func_ref( $kohafield, $frameworkcode );
&$func_ref( $kohafield );
}
});

4
t/db_dependent/Serials.t

@ -145,8 +145,8 @@ subtest 'Values should not be erased on editing' => sub {
my $biblio = $builder->build_sample_biblio();
my $biblionumber = $biblio->biblionumber;
my ( $icn_tag, $icn_sf ) = GetMarcFromKohaField( 'items.itemcallnumber', '' );
my ( $it_tag, $it_sf ) = GetMarcFromKohaField( 'items.itype', '' );
my ( $icn_tag, $icn_sf ) = GetMarcFromKohaField( 'items.itemcallnumber' );
my ( $it_tag, $it_sf ) = GetMarcFromKohaField( 'items.itype' );
my $itemtype = $builder->build( { source => 'Itemtype' } )->{itemtype};
my $itemcallnumber = 'XXXmy itemcallnumberXXX';

4
t/db_dependent/XISBN.t

@ -29,9 +29,9 @@ my $errors;
my $context = C4::Context->new;
my ( $biblionumber_tag, $biblionumber_subfield ) =
GetMarcFromKohaField( 'biblio.biblionumber', '' );
GetMarcFromKohaField( 'biblio.biblionumber' );
my ( $isbn_tag, $isbn_subfield ) =
GetMarcFromKohaField( 'biblioitems.isbn', '' );
GetMarcFromKohaField( 'biblioitems.isbn' );
# Harry Potter and the Sorcerer's Stone, 1st American ed. 1997
my $isbn1 = '0590353403';

8
tools/batchMod.pl

@ -160,7 +160,7 @@ if ($op eq "action") {
}
#initializing values for updates
my ( $itemtagfield, $itemtagsubfield) = &GetMarcFromKohaField("items.itemnumber", "");
my ( $itemtagfield, $itemtagsubfield) = &GetMarcFromKohaField( "items.itemnumber" );
if ($values_to_modify){
my $xml = TransformHtmlToXml(\@tags,\@subfields,\@values,\@indicator,\@ind_tag, 'ITEM');
$marcitem = MARC::Record::new_from_xml($xml, 'UTF-8');
@ -536,8 +536,8 @@ sub BuildItemsData{
my %witness; #---- stores the list of subfields used at least once, with the "meaning" of the code
my @big_array;
#---- finds where items.itemnumber is stored
my ( $itemtagfield, $itemtagsubfield) = &GetMarcFromKohaField("items.itemnumber", "");
my ($branchtagfield, $branchtagsubfield) = &GetMarcFromKohaField("items.homebranch", "");
my ( $itemtagfield, $itemtagsubfield) = &GetMarcFromKohaField( "items.itemnumber" );
my ($branchtagfield, $branchtagsubfield) = &GetMarcFromKohaField( "items.homebranch" );
foreach my $itemnumber (@itemnumbers){
my $itemdata = Koha::Items->find($itemnumber);
next unless $itemdata; # Should have been tested earlier, but just in case...
@ -622,7 +622,7 @@ sub BuildItemsData{
# And $tag>10
sub UpdateMarcWith {
my ($marcfrom,$marcto)=@_;
my ( $itemtag, $itemtagsubfield) = &GetMarcFromKohaField("items.itemnumber", "");
my ( $itemtag, $itemtagsubfield) = &GetMarcFromKohaField( "items.itemnumber" );
my $fieldfrom=$marcfrom->field($itemtag);
my @fields_to=$marcto->field($itemtag);
my $modified = 0;

Loading…
Cancel
Save