Fixing that Custom Forms didn't display a submit button text if there was none configured

The button text not being configured can happen on an 1.8 to 1.9 upgrade for example.
This commit is contained in:
Lombiq
2015-06-15 00:07:01 +02:00
parent 6aabc4d9f9
commit 1d445c5438

View File

@@ -8,6 +8,8 @@
// remove default Save/Publish buttons
Model.Zones["Sidebar"].Items.Clear();
var submitButtonText = String.IsNullOrEmpty(Model.ContentItem.CustomFormPart.SubmitButtonText) ? T("Submit").Text : Model.ContentItem.CustomFormPart.SubmitButtonText;
}
@Display(New.Parts_Title().Title(Html.ItemDisplayText(customForm)))
@@ -18,7 +20,7 @@
@Display(Model)
<fieldset class="submit-button">
<button type="submit" name="submit.Save" value="submit.Save">@Model.ContentItem.CustomFormPart.SubmitButtonText</button>
<button type="submit" name="submit.Save" value="submit.Save">@submitButtonText</button>
</fieldset>
}