Summary
============
TWiki shows internal instead of login form when access restricted web.
Problem Description
============
I create a twiki web named "MyTwikiWeb", the access control is set as below:
When I logout, and access the website again, internal error reported:
TWiki detected an internal error - please check your TWiki logs and webserver logs for more information.
Can't locate object method "get_handle" via package "TWiki::I18N"
It supposed to show the login form, that was correct on my previous version 4.3.2.
At the same time, the error messages are show in error_log:
[Wed Jan 02 20:03:10.879596 2013] [cgi:error] [pid 1753] [client 192.168.56.1:53655] AH01215: [Wed Jan 2 20:03:10 2013] view: defined(%hash) is deprecated at /home/web/apps/TWiki-5.1.3/lib/CPAN/lib//Locale/Maketext/Lexicon.pm line 286., referer:
http://192.168.56.101/twiki/bin/view/CoreLab/WebPreferences
[Wed Jan 02 20:03:10.879840 2013] [cgi:error] [pid 1753] [client 192.168.56.1:53655] AH01215: [Wed Jan 2 20:03:10 2013] view: \t(Maybe you should just omit the defined()?), referer:
http://192.168.56.101/twiki/bin/view/CoreLab/WebPreferences
[Wed Jan 02 20:03:10.977810 2013] [cgi:error] [pid 1753] [client 192.168.56.1:53655] AH01215: [Wed Jan 2 20:03:10 2013] view: Use of uninitialized value $tag in lc at /home/web/apps/TWiki-5.1.3/lib/TWiki/I18N.pm line 64., referer:
http://192.168.56.101/twiki/bin/view/CoreLab/WebPreferences
[Wed Jan 02 20:03:10.978354 2013] [cgi:error] [pid 1753] [client 192.168.56.1:53655] AH01215: Can't locate object method "get_handle" via package "TWiki::I18N" at /home/web/apps/TWiki-5.1.3/lib/TWiki/I18N.pm line 144., referer:
http://192.168.56.101/twiki/bin/view/CoreLab/WebPreferences
Environment
======
OS: Ubuntu 12.04.2
TWiki: 5.1.3
Perl&Apache: xampp 1.8.1 suitable, the detail is :
Apache/2.4.3 (Unix)
Perl 5.14.2
--
TWiki:Main/JinhuaWang
- 2013-01-02
I tried it out on my 5.1.3 installation and can't reproduce it. What configure settings do you use? Is this a fresh install, or did you do an upgrade?
--
TWiki:Main.PeterThoeny
- 2013-01-02
I can reproduce it now with
{UserInterfaceInternationalisation}
enabled.
--
TWiki:Main.PeterThoeny
- 2013-01-02
This is actually already fixed in trunk by
TWiki:Main.HideyoImazu
in
Item7098.
Patch:
--- twiki/lib/TWiki/I18N.pm (revision 24635)
+++ twiki/lib/TWiki/I18N.pm (working copy)
@@ -30,7 +30,7 @@
use strict;
use Assert;
-use vars qw( $initialised @initErrors );
+use vars qw( $initialised @initErrors @ISA );
=pod
@@ -79,11 +79,16 @@
# we first assume it's ok
$initialised = 1;
- eval "use base 'Locale::Maketext'";
+ # Item7098
+ # eval "use base 'Locale::Maketext'"; does not work as expected at lease
+ # in some cases. So 'require' and 'push(@ISA, ...)' are executed explictly
+ # instead.
+ eval 'require Locale::Maketext';
if ( $@ ) {
$initialised = 0;
push(@initErrors, "I18N: Couldn't load required perl module Locale::Maketext: " . $@."\nInstall the module or turn off {UserInterfaceInternationalisation}");
}
+ push(@ISA, 'Locale::Maketext');
unless( $TWiki::cfg{LocalesDir} && -e $TWiki::cfg{LocalesDir} ) {
push(@initErrors, 'I18N: {LocalesDir} not configured. Define it or turn off {UserInterfaceInternationalisation}');
--
TWiki:Main.PeterThoeny
- 2013-01-02
This is now also fixed in the 5.1 branch.
--
TWiki:Main.PeterThoeny
- 2013-01-02