From c52551c8d95a915a986a1b08ce33adfd4bbda69a Mon Sep 17 00:00:00 2001
From: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Date: Tue, 15 Nov 2016 11:10:51 +0000
Subject: [PATCH] Bug 17629: Koha::Biblio - Remove ModBiblioframework

There is only one call to C4::Biblio::ModBiblioframework, it's called
just before C4::Biblio::ModBiblio in cataloguing/addbiblio.pl
At first glance this call does not seems useful: all the subroutines
called from ModBiblio send the frameworkcode in parameter.

I'd go to remove it, but I'd like to get confirmation by others.

No test plan here, you need a good pair of eyes and deep into the
C4::Biblio code.
---
 C4/Biblio.pm             | 17 -----------------
 cataloguing/addbiblio.pl |  1 -
 2 files changed, 18 deletions(-)

diff --git a/C4/Biblio.pm b/C4/Biblio.pm
index 6d64e80..b00a10a 100644
--- a/C4/Biblio.pm
+++ b/C4/Biblio.pm
@@ -110,7 +110,6 @@ BEGIN {
     # To modify something
     push @EXPORT, qw(
       &ModBiblio
-      &ModBiblioframework
       &ModZebra
       &UpdateTotalIssues
       &RemoveAllNsb
@@ -386,22 +385,6 @@ sub _strip_item_fields {
     }
 }
 
-=head2 ModBiblioframework
-
-   ModBiblioframework($biblionumber,$frameworkcode);
-
-Exported function to modify a biblio framework
-
-=cut
-
-sub ModBiblioframework {
-    my ( $biblionumber, $frameworkcode ) = @_;
-    my $dbh = C4::Context->dbh;
-    my $sth = $dbh->prepare( "UPDATE biblio SET frameworkcode=? WHERE biblionumber=?" );
-    $sth->execute( $frameworkcode, $biblionumber );
-    return 1;
-}
-
 =head2 DelBiblio
 
   my $error = &DelBiblio($biblionumber);
diff --git a/cataloguing/addbiblio.pl b/cataloguing/addbiblio.pl
index 4615998..1929d0c 100755
--- a/cataloguing/addbiblio.pl
+++ b/cataloguing/addbiblio.pl
@@ -837,7 +837,6 @@ if ( $op eq "addbiblio" ) {
             BiblioAutoLink( $record, $frameworkcode );
         } 
         if ( $is_a_modif ) {
-            ModBiblioframework( $biblionumber, $frameworkcode ); 
             ModBiblio( $record, $biblionumber, $frameworkcode );
         }
         else {
-- 
2.1.4