Bug 7799 - admin/marctagstructure.pl plack scoping
authorDobrica Pavlinusic <dpavlin@rot13.org>
Thu, 22 Mar 2012 13:05:22 +0000 (14:05 +0100)
committerPaul Poulain <paul.poulain@biblibre.com>
Mon, 26 Mar 2012 16:15:56 +0000 (18:15 +0200)
duplicate_framework needs $dbh so we get it from C4::Context

Signed-off-by: Matthias Meusburger <matthias.meusburger@biblibre.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
admin/marctagstructure.pl

index 92e0d99..a86d788 100755 (executable)
@@ -348,6 +348,7 @@ sub StringSearch  {
 #
 sub duplicate_framework {
        my ($newframeworkcode,$oldframeworkcode) = @_;
+       my $dbh = C4::Context->dbh;
        my $sth = $dbh->prepare("select tagfield,liblibrarian,libopac,repeatable,mandatory,authorised_value from marc_tag_structure where frameworkcode=?");
        $sth->execute($oldframeworkcode);
        my $sth_insert = $dbh->prepare("insert into marc_tag_structure (tagfield, liblibrarian, libopac, repeatable, mandatory, authorised_value, frameworkcode) values (?,?,?,?,?,?,?)");