We were trying to create a topic from command line using "save", following the description on
TWikiScripts
. However we got the following error:
-bash-4.1# ./save -topic Sandbox.MyTopic2 -user admin -action save -text "New text of the topic"
[Wed Jan 11 11:45:29 2012] save: Use of uninitialized value in lc at /import/pae-www/twiki/lib/TWiki/UI/Save.pm line 469.
[Wed Jan 11 11:45:29 2012] save: Use of uninitialized value $reqmethod in pattern match (m//) at /import/pae-www/twiki/lib/TWiki/UI/Save.pm line 56.
-bash-4.1#
This fixes the issue (provided by
PeterThoeny):
--- TWiki/UI/Save.pm.save1 2011-08-20 21:03:51.000000000 -0700
+++ TWiki/UI/Save.pm 2012-01-11 14:06:22.000000000 -0800
@@ -53,8 +53,8 @@
my $revision = $query->param( 'rev' ) || undef;
my $reqmethod = $query->request_method();
- if( $reqmethod !~ /^POST$/i ) {
- # save can only be called via POST method
+ if( $reqmethod && $reqmethod !~ /^POST$/i ) {
+ # save can only be called via POST method or command line
throw TWiki::OopsException(
'attention',
def => 'post_method_only',
--
TWiki:Main/GuangyuShi
- 2012-01-11
Thanks Guangyu for reporting. This is now fixed in SVN trunk and 5.1 branch.
The warning on line 469 was already fixed.
--
TWiki:Main.PeterThoeny
- 2012-01-12