#
# This file is part of Koha.
#
-# Koha is free software; you can redistribute it and/or modify it under the
-# terms of the GNU General Public License as published by the Free Software
-# Foundation; either version 2 of the License, or (at your option) any later
-# version.
+# Koha is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
#
-# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
-# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
-# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+# Koha is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
#
-# You should have received a copy of the GNU General Public License along
-# with Koha; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+# You should have received a copy of the GNU General Public License
+# along with Koha; if not, see <http://www.gnu.org/licenses>.
# Note that at present this test is almost identical to the one testing
# the encapsulating method in Koha::MetadataRecord.
);
my $samplehash = [
{
- 'field' => [
- {
- 'value' => '1234',
- 'tag' => '001',
- }
- ]
+ 'value' => '1234',
+ 'tag' => '001',
},
{
- 'field' => [
+ 'subfield' => [
{
- 'subfield' => [
- {
- 'value' => 'Cooking',
- 'subtag' => 'a'
- }
- ],
- 'indicator2' => ' ',
- 'tag' => 150,
- 'indicator1' => ' ',
+ 'value' => 'Cooking',
+ 'subtag' => 'a'
}
- ]
+ ],
+ 'indicator2' => ' ',
+ 'tag' => 150,
+ 'indicator1' => ' ',
},
{
- 'field' => [
+ 'subfield' => [
+ {
+ 'value' => 'Cookery',
+ 'subtag' => 'a'
+ },
{
- 'subfield' => [
- {
- 'value' => 'Cookery',
- 'subtag' => 'a'
- },
- {
- 'value' => 'Instructional manuals',
- 'subtag' => 'z'
- }
- ],
- 'indicator2' => ' ',
- 'tag' => 450,
- 'indicator1' => ' ',
+ 'value' => 'Instructional manuals',
+ 'subtag' => 'z'
}
- ]
+ ],
+ 'indicator2' => ' ',
+ 'tag' => 450,
+ 'indicator1' => ' ',
}
];
my $hash = Koha::Util::MARC::createMergeHash($marcrecord);
my %fieldkeys;
foreach my $field (@$hash) {
- $fieldkeys{delete $field->{'field'}->[0]->{'key'}}++;
- if (defined $field->{'field'}->[0]->{'subfield'}) {
- foreach my $subfield (@{$field->{'field'}->[0]->{'subfield'}}) {
+ $fieldkeys{delete $field->{'key'}}++;
+ if (defined $field->{'subfield'}) {
+ foreach my $subfield (@{$field->{'subfield'}}) {
$fieldkeys{delete $subfield->{'subkey'}}++;
}
}