We are cleaning up legacy features/macros on a v7 site ahead of an upgrade. It's a very large site with a lot of historical content spanning 10 years, possibly more and the migration to a new version of Umbraco will take quite some time.
We have a lot of legacy content that still has references to old macros and we want to get rid of the now obsolete macros and still have the page contents rendered for the time being and silently hide any now-removed macros. Locating and amending all of that legacy content is not really feasible due to the volume and simply deleting the macro while it is still referenced in RTE content causes the entire contents of the RTE not to render because of an underlying exception.
Changing the MacroErrors setting to silent does not do the trick when the macro is missing, I'm guessing it just has a try/catch to swallow up any exceptions inside of the macro when it renders but not for the rendering process itself.
Any ideas on how the RTE content can still be rendered even though a macro within it no longer exists?
parse all RTEs for (I believe) <umb_macro and publish the content with the macros removed
Of course with #1 you're still stuck with them being there and you can't refactor and delete the actual macro.
Oh maybe one more thing you could try, I believe we have PropertyValueConverters in v7, they parse the RTE and convert macro's, so hopefully you could have a custom one that just ignores the macro parsing? Not sure.
Silently fail when legacy macro is deleted
We are cleaning up legacy features/macros on a v7 site ahead of an upgrade. It's a very large site with a lot of historical content spanning 10 years, possibly more and the migration to a new version of Umbraco will take quite some time.
We have a lot of legacy content that still has references to old macros and we want to get rid of the now obsolete macros and still have the page contents rendered for the time being and silently hide any now-removed macros. Locating and amending all of that legacy content is not really feasible due to the volume and simply deleting the macro while it is still referenced in RTE content causes the entire contents of the RTE not to render because of an underlying exception.
Changing the
MacroErrors
setting to silent does not do the trick when the macro is missing, I'm guessing it just has a try/catch to swallow up any exceptions inside of the macro when it renders but not for the rendering process itself.Any ideas on how the RTE content can still be rendered even though a macro within it no longer exists?
I can think of 2 options:
<umb_macro
and publish the content with the macros removedOf course with #1 you're still stuck with them being there and you can't refactor and delete the actual macro.
Oh maybe one more thing you could try, I believe we have PropertyValueConverters in v7, they parse the RTE and convert macro's, so hopefully you could have a custom one that just ignores the macro parsing? Not sure.
Thanks, Sebastiaan, the PropertyValueConverter idea I like and hadn't considered so thanks I will see if there is anything possible there.
is working on a reply...