Wysiwig was buggy in 4.2.0 on this same system, now it is broken completely. The plugin does not load at all.
The error
We get this error in InstalledPlugins page, =data/log<date>.txt files, and so on.
TWiki::Plugins::WysiwygPlugin could not be loaded. Errors were:
Too many arguments for Encode::decode_utf8 at /my/path/twiki/lib/TWiki/Plugins/WysiwygPlugin.pm line 621, near "Encode::FB_PERLQQ)"
BEGIN not safe after errors--compilation aborted at /my/path/twiki/lib/TWiki/Plugins/WysiwygPlugin.pm line 665.
Compilation failed in require at (eval 64) line 1.
BEGIN failed--compilation aborted at (eval 64) line 1.
Wysiwyg deps met
The dependencies listed here
http://twiki.org/cgi-bin/view/Plugins/WysiwygPlugin#Plugin_Info
indicate HTML::Parser >=3.28 and HTML::Entities >=1.25 are the only ones.
Our system has that.
me@aixbox:/usr/opt/perl5/lib/site_perl/5.8.2/aix-thread-multi/HTML
$ grep '\$VERSION =' Parser.pm
$VERSION = '3.35'; # $Date: 2008/12/08 23:57:47 $
me@aixbox:/usr/opt/perl5/lib/site_perl/5.8.2/aix-thread-multi/HTML
$ grep '\$Id:' Entities.pm
# $Id: Item6142.txt,v 1.7 2008/12/08 23:57:47 JefferyMartin Exp $
TWiki Perl reqs met
This page:
http://twiki.org/cgi-bin/view/TWiki/TWikiReleaseNotes04x02#Perl_5_8_is_now_minimum_requirem
indicates that Perl 5.8.x is required for this version of TWiki.
We have that, also.
me@aixbox:/usr/opt/perl5/lib/site_perl/5.8.2/aix-thread-multi/HTML
$ perl -v
This is perl, v5.8.2 built for aix-thread-multi
AIX version
FYI, for any AIX user stumbling upon this post, our AIX version is 5.3 ML 6.
$ oslevel -r
5300-06
Taking a quick look at line 621
Here is the line in
twiki/lib/TWiki/Plugins/WysiwygPlugin.pm
.
620
621 $text = Encode::decode_utf8($text, Encode::FB_PERLQQ);
622
That all seems to match up with the function call in the local perl docs.
me@aixbox:/usr/opt/perl5/lib64/5.8.2/aix-thread-multi-64all
$ perldoc Encode
$string = decode_utf8($octets [, CHECK]);
equivalent to "$string = decode("utf8", $octets [,
CHECK])". The sequence of octets represented by $octets
is decoded from UTF-8 into a sequence of logical
characters.
me@aixbox:/usr/opt/perl5/lib64/5.8.2/aix-thread-multi-64all
$ perldoc Encode
perlqq mode (CHECK = Encode::FB_PERLQQ)
HTML charref mode (CHECK = Encode::FB_HTMLCREF)
XML charref mode (CHECK = Encode::FB_XMLCREF)
For encodings that are implemented by Encode::XS, CHECK ==
Encode::FB_PERLQQ turns (en|de)code into "perlqq" fallback
mode.
From what I can tell from the above docs, you are calling the function OK.
My Encode.pm version
Our version of Encode.pm is:
jmm6ry@ccaiat58:/usr/opt/perl5/lib64/5.8.2/aix-thread-multi-64all
$ grep '\$Id:' Encode.pm
# $Id: Item6142.txt,v 1.7 2008/12/08 23:57:47 JefferyMartin Exp $
Is this high enough?
Sample code gets same error
I've distilled that line all by itself, and AIX's perl still complains.
me@aixbox:/home/me/sandbox
$ cat 1.pl
#!/usr/bin/perl -w
use strict;
use Encode;
my ($text) = @ARGV;
$text = Encode::decode_utf8($text, Encode::FB_PERLQQ);
print $text;
exit 66;
me@aixbox:/home/me/sandbox
$ ./1.pl This is a sentence.
Too many arguments for Encode::decode_utf8 at ./1.pl line 9, near "Encode::FB_PERLQQ)"
Execution of ./1.pl aborted due to compilation errors.
Looking at Linux Perl
Sure enough, the same line seems to work on Linux (RHEL 4, in this case) in perl 5.8.5.
me@mybox:~/sandbox
$ ./1.pl 'This is a sentence.'
This is a sentence.
me@mybox:~/sandbox
$ cat 1.pl
#!/usr/bin/perl -w
use strict;
use Encode;
my ($text) = @ARGV;
$text = Encode::decode_utf8($text, Encode::FB_PERLQQ);
print $text;
exit 66;
me@mybox:~/sandbox
$ perl --version
This is perl, v5.8.5 built for x86_64-linux-thread-multi
me@mybox:~/sandbox
$ uname -a
Linux mybox 2.6.9-78.0.1.ELsmp #1 SMP Tue Jul 22 18:01:05 EDT 2008 x86_64 x86_64 x86_64 GNU/Linux
So is the problem the Perl version difference (5.8.2 vs 5.8.5)? Or is it a problem with AIX's Perl implementation?
--
TWiki:Main.JefferyMartin
- 04 Dec 2008
Solution
I installed Perl 5.10 from sources
in an alternate directory. I left the system Perl alone.
The system Perl (5.8.2) simply will not allow the Wysiwyg plugin to load.
Comments
I had exactly the same error message on an older Linux box. After upgrading all required and recommended CPAN modules and adding Encode, the WYSIWYG editor worked properly.
--
TWiki:Main.PeterThoeny
- 04 Dec 2008
Peter, do you think perhaps the
TWiki system requirements page
needs to be modifed to indicate that Wysiwyg does not work on Perl < 5.8.5 or perhaps the
Wysiwyg plugin info section
needs to be modified?
--
TWiki:Main.JefferyMartin
- 04 Dec 2008
I have it running properly on Perl 5.8.0. In system requirements, I think the stated Perl version is OK, but we need to add the dependency on the CPAN Encode module on the system requirements page and
WysiwygPlugin page.
This dependency seems to be a recent addition since my test installation worked before.
--
TWiki:Main.PeterThoeny
- 05 Dec 2008
I added that the Encode module to
TWiki system requirements page
. I added it to
Wysiwyg plugin info section
, also.
--
TWiki:Main.JefferyMartin
- 08 Dec 2008