• 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.

Item6830: Can't save topic on command line, results in uninitialized value error

Item Form Data

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

Edit Form Data

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

Detail

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

ItemTemplate
Summary Can't save topic on command line, results in uninitialized value error
ReportedBy TWiki:Main.GuangyuShi
Codebase ~twiki4, 5.1.0
SVN Range TWiki-5.1.0, Wed, 04 Jan 2012, build 22458
AppliesTo Engine
Component

Priority Normal
CurrentState Closed
WaitingFor

Checkins TWikirev:22467 TWikirev:22468
TargetRelease patch
ReleasedIn 5.1.1
Edit | Attach | Watch | Print version | History: r5 < r4 < r3 < r2 < r1 | Backlinks | Raw View |  Raw edit | More topic actions
Topic revision: r5 - 2012-01-16 - GeorgeTrubisky
 
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