Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Simon Dingley 1470 posts 3427 karma points c-trib
    Aug 31, 2022 @ 11:42
    Simon Dingley
    0

    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?

  • Sebastiaan Janssen 5045 posts 15477 karma points MVP admin hq
    Sep 05, 2022 @ 11:33
    Sebastiaan Janssen
    1

    I can think of 2 options:

    1. leave the macro but remove their functionality
    2. 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.

  • Simon Dingley 1470 posts 3427 karma points c-trib
    Sep 05, 2022 @ 11:36
    Simon Dingley
    0

    Thanks, Sebastiaan, the PropertyValueConverter idea I like and hadn't considered so thanks I will see if there is anything possible there.

Please Sign in or register to post replies

Write your reply to:

Draft