Skip to content

Commit f50fd96

Browse files
committed
LUT-26660: Fix session error when refreshing a form
1 parent c567681 commit f50fd96

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/java/fr/paris/lutece/plugins/forms/web/FormXPage.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ private void checkMyLuteceAuthentification( Form form, HttpServletRequest reques
267267
public synchronized XPage getStepView( HttpServletRequest request ) throws SiteMessageException, UserNotSignedException
268268
{
269269
String paramInit = request.getParameter( FormsConstants.PARAMETER_INIT );
270-
if ( FormsConstants.PARAMETER_INIT.equals( paramInit ) )
270+
if ( Boolean.parseBoolean( paramInit ) )
271271
{
272272
init( request );
273273
}
@@ -361,7 +361,7 @@ public synchronized XPage getStepView( HttpServletRequest request ) throws SiteM
361361
SiteMessageService.setMessage( request, FormsConstants.MESSAGE_ERROR_INACTIVE_FORM, SiteMessage.TYPE_ERROR );
362362
}
363363
}
364-
IsRequestComingFromAction = false;
364+
IsRequestComingFromAction = true;
365365
XPage xPage = getXPage( TEMPLATE_VIEW_STEP, getLocale( request ), model );
366366
xPage.setTitle( strTitleForm );
367367
xPage.setPathLabel( strPathForm );
@@ -895,6 +895,8 @@ public synchronized XPage doSaveStep( HttpServletRequest request ) throws SiteMe
895895
// why are we here as we didn't try to save any backup ? So instead of throwing the error, we redirect.
896896
AppLogService.error("FormXPage l 897 : " + MESSAGE_ERROR_TOKEN );
897897
_currentStep = StepHome.findByPrimaryKey(Integer.parseInt(request.getParameter(FormsConstants.PARAMETER_ID_STEP)));
898+
List<String> errorList = new ArrayList<>( );
899+
_currentStep = FormsResponseUtils.getNextStep( _currentStep.getId( ), errorList, _formResponseManager );
898900
return getStepView( request );
899901
}
900902

@@ -1311,6 +1313,7 @@ private void init( HttpServletRequest request )
13111313
_stepDisplayTree = null;
13121314
_breadcrumb = null;
13131315
_bInactiveStateBypassed = false;
1316+
IsRequestComingFromAction = false;
13141317
FormsAsynchronousUploadHandler.getHandler( ).removeSessionFiles( request.getSession( ) );
13151318
}
13161319

@@ -1326,6 +1329,7 @@ private void init( int nIdForm )
13261329
_formResponseManager = null;
13271330
_stepDisplayTree = null;
13281331
_breadcrumb = null;
1332+
IsRequestComingFromAction = false;
13291333
}
13301334

13311335
/**

0 commit comments

Comments
 (0)