MT2502 : Reports Editor's 200$b to biblio's 210$c within unimarc_field_210c plugin
[koha_fer] / C4 / Biblio.pm
index 421010d..9669752 100755 (executable)
@@ -13,9 +13,9 @@ package C4::Biblio;
 # 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., 59 Temple Place,
-# Suite 330, Boston, MA  02111-1307 USA
+# 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 strict;
 use warnings;
@@ -1146,6 +1146,11 @@ sub GetCOinSBiblio {
     my $record = GetMarcBiblio($biblionumber);
 
     # get the coin format
+    if ( ! $record ) {
+       # can't get a valid MARC::Record object, bail out at this point
+       warn "We called GetMarcBiblio with a biblionumber that doesn't exist biblionumber=$biblionumber";
+       return;
+    }
     my $pos7 = substr $record->leader(), 7, 1;
     my $pos6 = substr $record->leader(), 6, 1;
     my $mtx;
@@ -2370,22 +2375,6 @@ sub PrepareItemrecordDisplay {
                         }
 
                         #---- "true" authorised value
-                    }
-                    elsif ( $tagslib->{$tag}->{$subfield}->{authorised_value} eq
-                        "cn_source" )
-                    {
-                      my $class_sources = GetClassSources();
-                      my $default_source = C4::Context->preference("DefaultClassificationSource");
-                      foreach my $class_source (sort keys %$class_sources) {
-                        next unless $class_sources->{$class_source}->{'used'} or
-                                    ($value and $class_source eq $value)      or
-                                    ($class_source eq $default_source);
-                        push @authorised_values, $class_source;
-                        $authorised_lib{$class_source} = $class_sources->{$class_source}->{'description'};
-                      }
-                      $value = $default_source unless ($value);
-
-                      #---- "true" authorised value
                     } else {
                         $authorised_values_sth->execute( $tagslib->{$tag}->{$subfield}->{authorised_value} );
                         push @authorised_values, ""