When submitting a comment before being logged in, we now get this error:
Incorrect parameters to the save script
But the save action actually is performed.
It looks like
TWiki::UI::Save->buildNewTopic
is expecting a save parameter when that parameter is eaten in the login script (that uses
twiki_redirect_cache
).
Removing the check:
unless( scalar($query->param()) ) {
# insufficient parameters to save
throw TWiki::OopsException( 'attention',
def => 'bad_script_parameters',
web => $session->{webName},
topic => $session->{topicName},
params => [ $script ]);
}
makes this error go away.
But then the
origurl
parameter of CommentPlugin is also no longer working, so that parameter is lost as well.
Test:
SaveCommentBeforeLoginTest. Log out (how?) then add a comment.
--
AC
This was cause by checkin 11966 "implemented origurl param to the save script". The origurl parameter is used by the login script to determine where to redirect to after the login is complete. The new code now grabs that same value of origurl and tries to redirect to it
again.
I think there are two possible solutions; remove the origurl param from the redirect after the login completes, or change the name of the param used to redirect after a save. I will implement the former.
CC
Does not work yet as advertised: if I am logged out, and save a topic using
redirecturl
, I am not redirected to that topic.
Or need things to be changed to the login page?
I have used the just updated
CommentPlugin (in svn) with template
return
at the bottom of the examples page. Logged in: I am returned to the examples page. Not logged in: I am lead to the login page, and after logging in I go to the comments topic in Sandbox.
AC
Partly solved with
Item3309. Now I get redirected properly, but nothing gets saved!
AC
Someone had taken the %ORIGURL% out of the login template. Dont forget to enable redirect in
configure
.
CC
Still not possible to create a new topic when I am not logged in. When I am logged in no problem. Some save parameters must be lost.
AC
Create New Topic goes to an edit, not a save (at least it does for me) and AFIACT it works perfectly. Can you please be more specific as to what you are trying to do, and what happens?
CC
I will explain my case again. See
CommentPluginExamples#return.
- Log out.
- Enter some text in the comment box.
- You will be forced to login
- You will be lead to the comments topic in Sandbox, but with no text added
Now you are logged in, try again in
CommentPluginExamples#return.
- Enter some text in the comment box.
- CommentPluginExamples will be reloaded with the added text in the INCLUDEd blockquote
Before the changes to origurl/redirecturl/login I could also save text using the first scenario.
AC
As of SVN 12294 this issue seems resolved. At least things work fine. But natually with $TWiki::cfg{AllowRedirectUrl} = 1; And with
%TMPL:DEF{returnpromptbox}%
<input type="hidden" name="redirectto" value="%SCRIPTURL{view}%/%BASEWEB%/%BASETOPIC%" />
%TMPL:P{promptbox}%
%TMPL:END%
as the comment template
KJL
It still does not work on my site, neither with
SCRIPTURL
nor with
BASEWEB.BASETOPIC
, even with
AllowRedirectUrl
on.
AC
Can you please make sure you have svn updated, and that there are no local modifications blocking it. If you still see a problem, report your exact configuration (server platform, LocalSite.cfg, installed extensions) here. Ta.
CC
Confirmed to work on a fresh installation.
AC