[Koha-bugs] [Bug 20727] Replace usage of File::Spec->tmpdir with C4::Context->temporary_directory

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu Oct 18 02:48:08 CEST 2018


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20727

--- Comment #30 from David Cook <dcook at prosentient.com.au> ---
I'm guessing the redefined warnings come from some circular dependency... but
that's a red herring since we'd never run C4::Auth on its own anyway.

If I create a script and load "C4::Auth", the script compiles fine. 

In fact, if I remove the semi-colon from the end of "my $dir =
C4::Context::temporary_directory", the Koha web app still loads just fine. 

But I get the following when I try to compile the module:

perl -c "C4/Auth.pm"
Subroutine psgi_env redefined at C4/Auth.pm line 50.
Subroutine safe_exit redefined at C4/Auth.pm line 52.
Subroutine get_template_and_user redefined at C4/Auth.pm line 142.
Subroutine _version_check redefined at C4/Auth.pm line 715.
Subroutine _session_log redefined at C4/Auth.pm line 761.
Subroutine _timeout_syspref redefined at C4/Auth.pm line 768.
Subroutine checkauth redefined at C4/Auth.pm line 778.
Subroutine check_api_auth redefined at C4/Auth.pm line 1387.
Subroutine check_cookie_auth redefined at C4/Auth.pm line 1629.
syntax error at C4/Auth.pm line 1751, near "C4::Context::temporary_directory
        my "
Global symbol "$instance" requires explicit package name at C4/Auth.pm line
1751.
Global symbol "$dir" requires explicit package name at C4/Auth.pm line 1752.
Global symbol "$instance" requires explicit package name at C4/Auth.pm line
1752.
BEGIN not safe after errors--compilation aborted at C4/Auth.pm line 1928.

Interesting... I always thought that modules were compiled when they were
loaded using "use". Not even the BEGIN{} block in the module is run when loaded
using "use", which seems contradictory to experience...

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


More information about the Koha-bugs mailing list