A guy reached out from the #twiki channel, having problems configuring his freshly downloaded copy of TWiki-6.0.1.
When setting a password for the first time, he got a Perl error identical to this one:
http://twiki.org/cgi-bin/view/Support/SID-01978
:
Use of uninitialized value $_[0] in join or string at /var/www/twiki/lib/TWiki/Configure/UI.pm line 138.
I noticed that he used Perl 5.20, the same as the guy in the support ticket.
To resolve the issue, I applied a quickfix in his code, only joining those elements in
@_
that are defined:
- CGI::td({class=>'secondCol'}, join(' ', @_)))."\n";
+ CGI::td({class=>'secondCol'}, join(' ', grep{defined;} @_)))."\n";
My guess is that Perl 5.20 has implemented some security constraints that breaks compability.
Does anyone see any problem with implementing this in TWiki?
--
TWiki:Main/TerjeAndersen
- 2014-10-14
Thank you Terje! See more debug info at
TWiki:Support.SID-01981
- it's the
TMPDIR
that is undefined. So that issue needs to be addressed as well.
--
TWiki:Main.PeterThoeny
- 2014-10-14
I recommend to add this (untested) fix:
--- TWiki/Configure/Checkers/Environment.pm (revision 28198)
+++ TWiki/Configure/Checkers/Environment.pm (working copy)
@@ -29,7 +29,7 @@
my $this = shift;
my $block = '';
for my $key ( sort keys %ENV ) {
- $block .= $this->setting($key, $ENV{$key});
+ $block .= $this->setting( $key, defined $ENV{$key} ? $ENV{$key} : '(undefined)' );
}
$block = $this->foldableBlock(CGI::em( 'Environment variables' ),
'(read only) ', $block);
Could anyone verify if this fixes the issue on Perl 5.20? You should get
(undefined)
for undefined environment variables listed in the "Environment Variable" section of configure.
--
TWiki:Main.PeterThoeny
- 2014-10-14
In addition, apply Terje's fix too, but possibly return a more verbose message:
CGI::td({class=>'secondCol'}, join(' ', map{ defined $_ ? $_ : '(undefined)'; } @_)))."\n";
--
TWiki:Main.PeterThoeny
- 2014-10-14
It worked in my 5.12.2 perl with CGI module downgraded to 4.04.
--
TWiki:Main.DaniMolina
- 2014-10-27
This is now fixed with new pre-installed
CgiContrib, tracked in
Item7620: Add CGI to TWiki core distribution
--
TWiki:Main.PeterThoeny
- 2015-11-29