New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed issue #19528: Bad usability when open in a new tab for participant edit #3826
Conversation
…ant edit Dev: use Yii::app()->request->isAjaxRequest
Dev: function only used by this class
@@ -839,7 +838,14 @@ public function edit($iSurveyId, $iTokenId, $ajax = false) | |||
foreach ($aAdditionalAttributeFields as $attr_name => $desc) { | |||
$value = $request->getPost($attr_name, ''); | |||
if ($desc['mandatory'] == 'Y' && trim($value) == '') { | |||
$sOutput .= sprintf(gT("Notice: Field '%s' was left empty, even though it is a mandatory attribute."), $desc['description']) . '<br>'; | |||
/* All this part is disable via JS, no way to submit : issue #19548 https://bugs.limesurvey.org/view.php?id=19548*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you mean by disable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you mean by disable?
I put the number of mantis issue : https://bugs.limesurvey.org/view.php?id=19548
Here it's the PHP part : allow to save empty value in required attribute : but a JS function disable this.
"surveyid" => $iSurveyId, | ||
] | ||
); | ||
$this->getController()->redirect($redirectUrl); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this make sense if we are running on ajax mode?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We never get here (if ajax) , see https://github.com/LimeSurvey/LimeSurvey/pull/3826/files#diff-af8e690b7162e715acc4d95c2dd74fb97479066cf40a03d33de4c393df0250e3R867
\ls\ajax\AjaxHelper::outputError($firstError[0]); | ||
// App->end in AjaxHelper | ||
} | ||
App()->setFlashMessage(CHtml::errorSummary($token, '<div><strong>' . gT('The survey participant was not updated.') . '</strong></div>'), 'danger'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would run if on ajax mode?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just the test and the line before please, with the comment https://github.com/LimeSurvey/LimeSurvey/pull/3826/files#diff-af8e690b7162e715acc4d95c2dd74fb97479066cf40a03d33de4c393df0250e3R885
Dev: use Yii::app()->request->isAjaxRequest