Umbraco 8 caching CurrentUmbracoPage
See original GitHub issueHi, We have recently upgraded from Umbraco 6 to 8. One of the big changes in Umbraco is caching. There is an issue with displaying validation errors on some of our pages.
Reproduction
Bug summary
When having a form in a macro and with required fields, it is expected to see the required fields highlighted if they wee left out blank when submitting a form. However, probably because of caching, I am seeing the same page with no validation feedback when submitting an incomplete form.
Specifics
Steps to reproduce
- Create a controller with
[HttpPost]
method that receives form that follows the standard pattern:
if (ModelState.IsValid == false)
{
return CurrentUmbracoPage();
}
- Create a macroPartial form that will have form fields with validation, e.g.:
<div class="input-group">
@Html.LabelFor(m => model.Name)
@Html.EditorFor(m => model.Name)
@Html.ValidationMessageFor(m => model.Name)
</div>
-
Create a corresponding model with
Required
fields. -
Run the example, try to partially fill in the form and submit it.
Expected result
Umbraco displaying the same form and indicating which fields have not been filled\validated.
Actual result
Same form, with no validation feedback.
Additional context
I believe it is strongly connected to caching, because once I Reload Memory Cache in Umbraco backoffice, and refresh the page, it highlights the fields that have not been filled.
There is a link, which might be related:
It states that, " I am talking about retrieving a model from cache, and adding stuff to it - that will not work anymore."; which might be the case in this situation.
Thanks!
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (3 by maintainers)
I think that’s more likely the issue which is not related to the posted our thread above. Will need to investigate.
Fixed in https://github.com/umbraco/Umbraco-CMS/pull/6010 Cherry picked to 8.1.4 703092c12c979a8902afe7676c18beade4005f99