(Retrofit from trunk) N°606 Portal: Request template fields marked as invalid when a mandatory textarea field was empty.

SVN:2.3[4606]
This commit is contained in:
Guillaume Lajarige
2017-03-21 09:55:46 +00:00
parent de81fbcb09
commit 05289dc241

View File

@@ -411,6 +411,9 @@ EOF
break; break;
case 'Combodo\\iTop\\Form\\Field\\TextAreaField': case 'Combodo\\iTop\\Form\\Field\\TextAreaField':
case 'Combodo\\iTop\\Form\\Field\\CaseLogField': case 'Combodo\\iTop\\Form\\Field\\CaseLogField':
$bRichEditor = ($this->oField->GetFormat() === TextAreaField::ENUM_FORMAT_HTML);
if($bRichEditor)
{
// Overloading $sFormFieldOptions to include the set_current_value_callback. It would have been nicer to refactor the variable for all field types, but as this is a fix for a maintenance release, we rather be safe. // Overloading $sFormFieldOptions to include the set_current_value_callback. It would have been nicer to refactor the variable for all field types, but as this is a fix for a maintenance release, we rather be safe.
$sValidators = json_encode($aValidators); $sValidators = json_encode($aValidators);
$oOutput->AddJs( $oOutput->AddJs(
@@ -423,6 +426,15 @@ EOF
); );
// MagnificPopup on images // MagnificPopup on images
$oOutput->AddJs(InlineImage::FixImagesWidth()); $oOutput->AddJs(InlineImage::FixImagesWidth());
}
else
{
$oOutput->AddJs(
<<<EOF
$("[data-field-id='{$this->oField->GetId()}'][data-form-path='{$this->oField->GetFormPath()}']").portal_form_field($sFormFieldOptions);
EOF
);
}
break; break;
} }