Commit b2a3f33b authored by Carsten  Rose's avatar Carsten Rose
Browse files

Bug #4504 / Upload Button: required asterik missing after save - seems to be a...

Bug #4504 / Upload Button: required asterik missing after save - seems to be a problem for every element - should be fixed now.
parent 6791e7c7
......@@ -860,7 +860,8 @@ abstract class AbstractBuildForm {
if (isset($formElement[FE_LABEL])) {
$key = $formElement[FE_HTML_ID] . HTML_ID_EXTENSION_LABEL;
$json[API_ELEMENT_UPDATE][$key][API_ELEMENT_CONTENT] = $this->buildLabel($htmlFormElementName, $formElement[FE_LABEL]);
$addClass = ($formElement[FE_MODE] == FE_MODE_REQUIRED) ? CSS_REQUIRED : '';
$json[API_ELEMENT_UPDATE][$key][API_ELEMENT_CONTENT] = $this->buildLabel($htmlFormElementName, $formElement[FE_LABEL], $addClass);
}
if (isset($formElement[FE_NOTE])) {
......@@ -2815,6 +2816,9 @@ abstract class AbstractBuildForm {
$attribute .= Support::doAttribute('data-load', ($formElement[FE_DYNAMIC_UPDATE] === 'yes') ? 'data-load' : '');
$attribute .= Support::doAttribute('data-sip', $sipUpload);
$json = $this->getFormElementForJson($htmlFormElementName, $value, $formElement); // Below, $formElement[FE_MODE]=FE_MODE_REQUIRED will be changed. Get the JSON unchanged
if ($value === '' || $value === false) {
$textDeleteClass = 'hidden';
$uploadClass = '';
......@@ -2841,7 +2845,6 @@ abstract class AbstractBuildForm {
// <button type="button" class="file-delete" data-sip="571d1fc9e6974"><span class="glyphicon glyphicon-trash"></span></button>
$json = $this->getFormElementForJson($htmlFormElementName, $value, $formElement);
$formElement = HelperFormElement::prepareExtraButton($formElement, false);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment