Lombiq / Helpful-Extensions

Orchard Core / Orchard 1.x module containing some handy extensions.
BSD 3-Clause "New" or "Revised" License
34 stars 16 forks source link

Shape tracing doesn't display wrappers (OSOE-340) #18

Open mvarblow opened 3 years ago

mvarblow commented 3 years ago

Thanks for sharing these helpers! The shape tracing helper really filled a need for us. However, one thing I noticed... it doesn't seem to report wrappers. I think the problem is that OrchardCore processes and then clears the wrappers before firing the Displayed event that the shape tracing module hooks into.

Wrappers are cleared here: https://github.com/OrchardCMS/OrchardCore/blob/1879619df4418ff175a59ba70dcb36bab89fcbb5/src/OrchardCore/OrchardCore.DisplayManagement/Implementation/DefaultHtmlDisplay.cs#L137

But the displayed event is fired just a bit later, here: https://github.com/OrchardCMS/OrchardCore/blob/1879619df4418ff175a59ba70dcb36bab89fcbb5/src/OrchardCore/OrchardCore.DisplayManagement/Implementation/DefaultHtmlDisplay.cs#L144

Jira issue

Piedone commented 3 years ago

Thanks for the details, Matt! It seems indeed that's the case. I'm not sure how to solve this, however. The Displaying event is invoked earlier, however, that's where wrappers are commonly added (like DynamicCacheShapeDisplayEvents and MediaShapes) so unless the Helpful Extensions feature depends on everything else, it won't necessarily see all the wrappers (or maybe we can get it run after everything else with Startup.Order.