Copied to clipboard

Flag this post as spam?

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


  • Tom van Enckevort 100 posts 387 karma points
    Dec 05, 2018 @ 10:16
    Tom van Enckevort
    0

    Custom UrlProvider gives blank URLs in CMS

    I've got a v7.12.4 site and I'm trying to create a custom UrlProvider to handle the URLs of some specific nodes. But the main problem I have is that as soon as I register a custom UrlProvider the Links in the Info tab of each node in the CMS disappear. So it's displaying no URLs there, but the pages themselves still work fine.

    I've even gone back to a very basic UrlProvider with no custom logic in it at all:

    public class SiteUrlProvider : DefaultUrlProvider
    {
        public SiteUrlProvider() : base(UmbracoConfig.For.UmbracoSettings().RequestHandler)
        {
        }
    
        public SiteUrlProvider(IRequestHandlerSection requestSettings) : base(requestSettings)
        {
        }
    }
    

    Sot it's basically exactly the same as the default URL provider. And then I register it in the ApplicationStarting event:

    protected override void ApplicationStarting(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)
    {
        UrlProviderResolver.Current.InsertTypeBefore<DefaultUrlProvider, SiteUrlProvider>();
    }
    

    I can't see any errors in the logs, and apart from the blank Links in the CMS, the URLs work fine on the frontend.

    Has anyone else encountered this before?

  • MuirisOG 378 posts 1276 karma points
    Dec 05, 2018 @ 11:00
    MuirisOG
    0

    I haven't seen this but have you tried republishing the site?

    thanks

    Muiris

  • Tom van Enckevort 100 posts 387 karma points
    Dec 05, 2018 @ 11:05
    Tom van Enckevort
    0

    Yes, I have tried republishing and restarting the site a few times.

  • MuirisOG 378 posts 1276 karma points
    Dec 05, 2018 @ 11:28
    MuirisOG
    0

    Tom

    I'm on v7.5.14 and have put the ContentFinders and UrlProviders into a separate class library.

    My UrlProvider inherits from iUrlProvider and contains two methods, i.e. GetUrl(...) and GetOtherUrls(…) so I think I have a different implementation to you, and I may not be able to help.

    Sorry,

    Muiris

  • Tom van Enckevort 100 posts 387 karma points
    Dec 12, 2018 @ 12:37
    Tom van Enckevort
    0

    I've created an issue for this on Github, since it's reproducible on a blank install as well: https://github.com/umbraco/Umbraco-CMS/issues/3842

Please Sign in or register to post replies

Write your reply to:

Draft