• Do not register here on develop.twiki.org, login with your twiki.org account.
• Use View topic Item7848 for generic doc work for TWiki-6.1.1. Use View topic Item7851 for doc work on extensions that are not part of a release. More... Close
• Anything you create or change in standard webs (Main, TWiki, Sandbox etc) will be automatically reverted on every SVN update.
Does this site look broken?. Use the LitterTray web for test cases.

Item7114: Can't locate object method 'get_handle' via package 'TWiki::I18N' error when accessing restricted web

Item Form Data

AppliesTo: Component: Priority: CurrentState: WaitingFor: TargetRelease ReleasedIn
Engine   Normal Closed   patch 5.1.4

Edit Form Data

Summary:
Reported By:
Codebase:
Applies To:
Component:
Priority:
Current State:
Waiting For:
Target Release:
Released In:
 

Detail

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

======

VM: VirtualBox 4.2.6

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

ItemTemplate
Summary Can't locate object method 'get_handle' via package 'TWiki::I18N' error when accessing restricted web
ReportedBy TWiki:Main.JinhuaWang
Codebase 5.1.3
SVN Range TWiki-5.1.3-trunk, Tue, 01 Jan 2013, build 24634
AppliesTo Engine
Component

Priority Normal
CurrentState Closed
WaitingFor

Checkins TWikirev:24687
TargetRelease patch
ReleasedIn 5.1.4
Edit | Attach | Watch | Print version | History: r7 < r6 < r5 < r4 < r3 | Backlinks | Raw View |  Raw edit | More topic actions
Topic revision: r7 - 2013-02-18 - PeterThoeny
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback