[Koha-bugs] [Bug 11037] C4::Biblio exports non-existent subroutines

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Oct 11 14:01:26 CEST 2013


http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11037

M. Tompsett <mtompset at hotmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mtompset at hotmail.com

--- Comment #2 from M. Tompsett <mtompset at hotmail.com> ---
I wrote the following test and ran it before and after the patch. As expected,
the routines were exported before (notice the text is &C4::Biblio), but they
were undefined. After the patch, they are no longer in C4::Biblio (notice the
text is now &main::), and are still undefined.

mtompset at ubuntu:~/kohaclone$ cat ~/test_missing.t
#!/usr/bin/perl

use Modern::Perl;
use Test::More tests => 3;
use Try::Tiny;

BEGIN {
    use_ok('C4::Biblio');
}

my $check1 = try { Get(); }
             catch { "$_"; }
             finally { "ok"; };
print "CHECK: $check1\n";
ok( $check1 =~ /Undefined/ , "Get() is undefined." );
my $check2 = try { TransformHtmlToMarc2(); }
             catch { "$_"; }
             finally { "ok"; };
print "CHECK: $check2\n";
ok( $check2 =~ /Undefined/ , "TransformHtmlToMarc2() is undefined." );
mtompset at ubuntu:~/kohaclone$ prove -v ~/test_missing.t
/home/mtompset/test_missing.t ..
1..3
ok 1 - use C4::Biblio;
CHECK: Undefined subroutine &C4::Biblio::Get called at
/home/mtompset/test_missing.t line 11.
ok 2 - Get() is undefined.
CHECK: Undefined subroutine &C4::Biblio::TransformHtmlToMarc2 called at
/home/mtompset/test_missing.t line 16.
ok 3 - TransformHtmlToMarc2() is undefined.
ok
All tests successful.
Files=1, Tests=3,  0 wallclock secs ( 0.01 usr  0.00 sys +  0.22 cusr  0.00
csys =  0.23 CPU)
Result: PASS
mtompset at ubuntu:~/kohaclone$ git bz apply 11037
Bug 11037 - C4::Biblio exports non-existent subroutines

21959 - Proposed patch

Apply? [(y)es, (n)o, (i)nteractive] y
Applying: Bug 11037 Remove non-existent subs from Biblio's @EXPORT
mtompset at ubuntu:~/kohaclone$ prove -v ~/test_missing.t
/home/mtompset/test_missing.t ..
1..3
ok 1 - use C4::Biblio;
CHECK: Undefined subroutine &main::Get called at /home/mtompset/test_missing.t
line 11.
ok 2 - Get() is undefined.
CHECK: Undefined subroutine &main::TransformHtmlToMarc2 called at
/home/mtompset/test_missing.t line 16.
ok 3 - TransformHtmlToMarc2() is undefined.
ok
All tests successful.
Files=1, Tests=3,  0 wallclock secs ( 0.01 usr  0.00 sys +  0.21 cusr  0.00
csys =  0.22 CPU)
Result: PASS

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list