SID-02453: save command line problem in TWiki-6.1.0
| Status: |
Answered |
TWiki version: |
6.1.0 |
Perl version: |
v5.16.3 |
| Category: |
CategoryError |
Server OS: |
RedHat Linux 7.5 |
Last update: |
5 years ago |
Hello!
For years I've been auto-generating TWiki pages/reports from scripts and doing a command line save on a TWiki formatted file to add it to our TWiki web. This was on TWiki-5.0.1. I've upgraded to TWiki-6.1.0 and everything is working, except the command line save now fails. I had a similar problem with a web app I created and the resolution was to use 'method=post' when creating a new page from, for exammple, a template, like this:
<form name="new" action="%SCRIPTURLPATH{save}%/%WEB%/" method="post">
When I run the command line 'save' on TWiki-6.1.0 with a formatted input file, I get an error saying I must use method=post
Exmaple save command:
cd $TWIKI_BIN_DIR
./save -topic
InventoryReport -user VALID_USER -text "This is a test"
The output/error I get from the command is:
The save script can only be called with POST method. Example:
<form name="new" action="/twiki/bin/save/Sandbox/" method="post"> ... </form>
I've tried a number of ways, but I can't seem to get this to work. Anyone know how I can use the method=post in the command line save script so i can get this to work?
Thanks!
--
David Brezy - 2020-09-15
Discussion and Answer
Issue confirmed, tracked in
TWikibug:Item7910
--
Peter Thoeny - 2020-09-16
This is fixed, see
TWikibug:Item7910
Apply this patch:
--- lib/TWiki/UI/Save.pm (revision 30798)
+++ lib/TWiki/UI/Save.pm (working copy)
@@ -53,7 +53,7 @@
my $revision = $query->param( 'rev' ) || undef;
my $reqmethod = $query->request_method();
- if( $reqmethod && $reqmethod !~ /^POST$/i ) {
+ if( $reqmethod && $reqmethod !~ /^POST$/i && !$session->inContext('command_line') ) {
# save can only be called via POST method or command line
throw TWiki::OopsException(
'attention',
--
Peter Thoeny - 2020-09-16
If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.