I am trying to retrieve rich text from a block list block during indexing. I cannot seem to access it if it contains a macro. I am guessing that Umbraco needs to render the macro, but it has no rendering context. I see an error occurring at
MacroRenderer.
I do not see public properties that allow me to get the raw data, which would be acceptable for the indexing process. Is there a way to do either of the following during indexing process?:
- Access raw data of rich text without trigger macrorenderer.
- Provide context during indexing so that macrorenderer can be successful.
I have tried setting MacroErrors to Silent to no avail.
Below is the stack trace at the error point:
System.ArgumentNullException HResult=0x80004003 Message=Value
cannot be null. (Parameter ‘content’) Source=Umbraco.Web.Common
StackTrace: at
Umbraco.Cms.Web.Common.Macros.MacroRenderer.d__23.MoveNext()
at
Umbraco.Cms.Web.Common.Macros.MacroRenderer.d__22.MoveNext()
at
Umbraco.Cms.Core.PropertyEditors.ValueConverters.RteMacroRenderingValueConverter.<>c__DisplayClass24_0.b__1(String
macroAlias, Dictionary2 macroAttributes) at Umbraco.Cms.Infrastructure.Macros.MacroTagParser.ParseMacros(String text, Action1 textFoundCallback, Action`2 macroFoundCallback) at
Umbraco.Cms.Core.PropertyEditors.ValueConverters.RteMacroRenderingValueConverter.RenderRteMacros(String
source, Boolean preview) at
Umbraco.Cms.Core.PropertyEditors.ValueConverters.RteMacroRenderingValueConverter.Convert(Object
source, Boolean preview) at
Umbraco.Cms.Core.PropertyEditors.ValueConverters.RteMacroRenderingValueConverter.ConvertIntermediateToObject(IPublishedElement
owner, IPublishedPropertyType propertyType, PropertyCacheLevel
referenceCacheLevel, Object inter, Boolean preview) at
Umbraco.Cms.Core.Models.PublishedContent.PublishedPropertyType.ConvertInterToObject(IPublishedElement
owner, PropertyCacheLevel referenceCacheLevel, Object inter, Boolean
preview) at
Umbraco.Cms.Core.PublishedCache.PublishedElementPropertyBase.GetValue(String
culture, String segment) at
Umbraco.Extensions.PublishedPropertyExtension.Value[T](IPublishedProperty
property, IPublishedValueFallback publishedValueFallback, String
culture, String segment, Fallback fallback, T defaultValue) at
Umbraco.Extensions.PublishedElementExtensions.Value[T](IPublishedElement
content, IPublishedValueFallback publishedValueFallback, String alias,
String culture, String segment, Fallback fallback, T defaultValue)
at
Umbraco.Cms.Web.Common.PublishedModels.RichTextBase.GetRichText(IRichTextBase
that, IPublishedValueFallback publishedValueFallback) in
E:\Projects\CLIENT-Cloud-Dev\src\Foundation\Client.Foundation.Models\RichTextBase.generated.cs:line
73This exception was originally thrown at this call stack:
[External Code]
Umbraco.Cms.Web.Common.PublishedModels.RichTextBase.GetRichText(Umbraco.Cms.Web.Common.PublishedModels.IRichTextBase,
Umbraco.Cms.Core.Models.PublishedContent.IPublishedValueFallback) in
RichTextBase.generated.cs
This is a companion discussion topic for the original entry at https://our.umbraco.com/forum/114528-umbraco-13-access-rich-text-that-contains-macro-in-block-list-without-a-rendering-context