From 8f87903968fe19a801dbd14246321bf585c679e6 Mon Sep 17 00:00:00 2001 From: Mason James Date: Wed, 20 Sep 2017 15:59:43 +1200 Subject: [PATCH] Revert "Bug 17249: Remove GetKohaAuthorisedValuesFromField - Add classes MarcSubfieldStructure[s]" This reverts commit 99e7f928b1bdd7ca997c6ae403a691f90866eeb4. --- Koha/MarcSubfieldStructure.pm | 44 --------------- Koha/MarcSubfieldStructures.pm | 50 ----------------- t/db_dependent/Koha/MarcSubfieldStructures.t | 57 -------------------- 3 files changed, 151 deletions(-) delete mode 100644 Koha/MarcSubfieldStructure.pm delete mode 100644 Koha/MarcSubfieldStructures.pm delete mode 100644 t/db_dependent/Koha/MarcSubfieldStructures.t diff --git a/Koha/MarcSubfieldStructure.pm b/Koha/MarcSubfieldStructure.pm deleted file mode 100644 index f55da048e8..0000000000 --- a/Koha/MarcSubfieldStructure.pm +++ /dev/null @@ -1,44 +0,0 @@ -package Koha::MarcSubfieldStructure; - -# 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 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. -# -# 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. - -use Modern::Perl; - -use Carp; - -use Koha::Database; - -use base qw(Koha::Object); - -=head1 NAME - -Koha::MarcSubfieldStructure - Koha MarcSubfieldStructure Object class - -=head1 API - -=head2 Class Methods - -=cut - -=head3 type - -=cut - -sub _type { - return 'MarcSubfieldStructure'; -} - -1; diff --git a/Koha/MarcSubfieldStructures.pm b/Koha/MarcSubfieldStructures.pm deleted file mode 100644 index c2f565630e..0000000000 --- a/Koha/MarcSubfieldStructures.pm +++ /dev/null @@ -1,50 +0,0 @@ -package Koha::MarcSubfieldStructures; - -# 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 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. -# -# 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. - -use Modern::Perl; - -use Carp; - -use Koha::Database; - -use Koha::MarcSubfieldStructure; - -use base qw(Koha::Objects); - -=head1 NAME - -Koha::MarcSubfieldStructures - Koha MarcSubfieldStructure Object set class - -=head1 API - -=head2 Class Methods - -=cut - -=head3 type - -=cut - -sub _type { - return 'MarcSubfieldStructure'; -} - -sub object_class { - return 'Koha::MarcSubfieldStructure'; -} - -1; diff --git a/t/db_dependent/Koha/MarcSubfieldStructures.t b/t/db_dependent/Koha/MarcSubfieldStructures.t deleted file mode 100644 index b61837a615..0000000000 --- a/t/db_dependent/Koha/MarcSubfieldStructures.t +++ /dev/null @@ -1,57 +0,0 @@ -#!/usr/bin/perl - -# Copyright 2016 Koha Development team -# -# 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 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. -# -# You should have received a copy of the GNU General Public License -# along with Koha; if not, see . - -use Modern::Perl; - -use Test::More tests => 3; - -use Koha::MarcSubfieldStructure; -use Koha::MarcSubfieldStructures; -use Koha::Database; - -use t::lib::TestBuilder; - -my $schema = Koha::Database->new->schema; -$schema->storage->txn_begin; - -my $builder = t::lib::TestBuilder->new; -my $nb_of_fields = Koha::MarcSubfieldStructures->search->count; -my $framework = $builder->build({ source => 'BiblioFramework' }); -my $new_field_1 = Koha::MarcSubfieldStructure->new({ - frameworkcode => $framework->{frameworkcode}, - tagfield => 200, - tagsubfield => 'a', -})->store; -my $new_field_2 = Koha::MarcSubfieldStructure->new({ - frameworkcode => $framework->{frameworkcode}, - tagfield => 245, - tagsubfield => 'a', -})->store; - -is( Koha::MarcSubfieldStructures->search->count, $nb_of_fields + 2, 'The 2 fields should have been added' ); - -my $retrieved_fields = Koha::MarcSubfieldStructures->search({ frameworkcode => $framework->{frameworkcode}, tagfield => 200, tagsubfield => 'a' }); -is( $retrieved_fields->count, 1, 'Search for a field by frameworkcode, tagfield and tagsubfield should return the field' ); - -$retrieved_fields->next->delete; -is( Koha::MarcSubfieldStructures->search->count, $nb_of_fields + 1, 'Delete should have deleted the field' ); - -$schema->storage->txn_rollback; - -1; -- 2.39.5