question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Umbraco 8 caching CurrentUmbracoPage

See original GitHub issue

Hi, 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

  1. Create a controller with [HttpPost] method that receives form that follows the standard pattern:
if (ModelState.IsValid == false)
{
      return CurrentUmbracoPage();
}
  1. 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>
  1. Create a corresponding model with Required fields.

  2. 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:

https://our.umbraco.com/forum/umbraco-8/92359-how-will-the-nucache-influence-model-alteration-in-the-pipeline

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:closed
  • Created 4 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Shazwazzacommented, Jul 24, 2019

I think that’s more likely the issue which is not related to the posted our thread above. Will need to investigate.

0reactions
nul800sebastiaancommented, Aug 22, 2019

Fixed in https://github.com/umbraco/Umbraco-CMS/pull/6010 Cherry picked to 8.1.4 703092c12c979a8902afe7676c18beade4005f99

Read more comments on GitHub >

github_iconTop Results From Across the Web

return currentumbracopage results in error loading partial ...
IsValid is set to false and CurrentUmbracoPage() is returned. ... in the Umbraco back office as this will cache validation messages, etc.
Read more >
umbraco 8 runtime cache
Hey, I've been trying to replicate this caching from one of our v7 sites in a new Umbraco 8 site, however lots has...
Read more >
Surface controllers - Umbraco CMS
Therefore, all surface controllers have native Umbraco support for: Interacting with Umbraco routes during HTTP POSTs (i.e. return CurrentUmbracoPage(); ).
Read more >
umbraco 8 refresh memory cache taking over 30 minutes
I've got a bit of a weird issue here, but our Umbraco installation is taking about 30 minutes to refresh the memory cache....
Read more >
reload cache method - Umbraco 8
Hi. I need to reload the in-memory and local file cache programmatically. Is there a method in the Umbraco.Core.Cache that I can call...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found