[Koha-bugs] [Bug 12884] Get rid of redefined subroutine warnings from dateaccessioned.pl

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Mon Sep 15 17:59:27 CEST 2014


http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12884

--- Comment #5 from M. de Rooy <m.de.rooy at rijksmuseum.nl> ---
(In reply to Owen Leonard from comment #3)
> I don't see any errors in my log related to dateaccessioned.pl. What steps
> should I take to reproduce this problem?

This has to do with the order in which the plugins are defined/redefined.
Create an item with a subfield d (dateaccessioned) and p (barcode).
Verify that both are connected to a plugin (should be by default).
If d and p are the only ones loaded and d goes before p, you will have no
warnings.

The order of plugin definition depends on additem line 771:
  foreach my $subfield ( $field->subfields() )
So it depends on MARC::Field; the internal _subfields in MARC::Field seems not
to be sorted; new subfields are added at the end.

An easy way to force this problem, is add a sort at line 771:
  foreach my $subfield ( sort { $a->[0] lt $b->[0] } $field->subfields() )
In my simple test case p now goes before d and you should have warnings.

Note that I had the errors by default in 3.14 and not in master. But it just
depends on circumstances, data etc. If you add a plugin before d, you could
probably force it too.

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list