Umbraco-cms: Macro in Editor returns Cached data in 8.1.0

Created on 24 Jul 2019  路  7Comments  路  Source: umbraco/Umbraco-CMS

If you use a PartialViewMacroPage with a Macro inside a TinyMCE Editor, the Page returns a cached result of the PartialViewMacroPage.

Reproduction

If you're filing a bug, please describe how to reproduce it. Include as much
relevant information as possible, such as:

Bug summary

Page returns cached macro output for each request in combination of rich text editor.

Specifics

Problem in Umbraco 8.1.0

Steps to reproduce

  • Create a Partial Macro with an @DateTime.Now.Ticks output
  • Create a Marco which uses the Partial Maco and Use in richt text editor and the grid enabled, Cache Period 0, Cache by Page Disable, Cache personalized disabled.
  • Create a Page with an TinyMCE Editor Field an use the Macro inside the Editor.
  • Plublish and show the page. The ticks will only changed, if you publish again.

Expected result

Cache Settings should be applied.

Actual result

Cache Settings are ignored

communitpr releas8.1.4 typbug

Most helpful comment

Attached I've added a dll with a workaround for this issue. It is a PropertyValueConvertor that overrides the default on in Core. I had to name it Umbraco.Tests.dll because I needed to access some internal methods in Umbraco.

If you need this, please make sure to drop this dll in the bin folder and do not forget to remove it when you upgrade to 8.1.4 (coming out soon!).

Umbraco.Tests.dll.zip

All 7 comments

I think this could be the same issue as #5984 (which was reported yesterday)

The RteMacroRenderingValueConverter sets its cache level to Snapshot, but that isn't actually doing what we want it to. That cache level is used when caching the ObjectValue and XPathValue, but the macro rendering is happening in ConvertSourceToIntermediate. The intermediate value is effectively always cached at the Element level.

This could be a potential security issue. I the macro Display user specific informations, it's possible you can see Information from an other user.

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

Attached I've added a dll with a workaround for this issue. It is a PropertyValueConvertor that overrides the default on in Core. I had to name it Umbraco.Tests.dll because I needed to access some internal methods in Umbraco.

If you need this, please make sure to drop this dll in the bin folder and do not forget to remove it when you upgrade to 8.1.4 (coming out soon!).

Umbraco.Tests.dll.zip

Thanks very much @nul800sebastiaan for fixing this!

I am looking forward to the 8.1.4 release.

All praise needs to go to @stevemegson for finding and fixing the underlying problem! 馃帠 馃弲 馃 馃憤

Was this page helpful?
0 / 5 - 0 ratings