Copied to clipboard

Flag this post as spam?

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


  • Jesper Balle 5 posts 26 karma points
    Feb 20, 2011 @ 20:41
    Jesper Balle
    0

    ClientDependency and Canvas editing

    Hi

    I am using Umbraco 4.6.1 and would like to use the smart ClientDependency for minifying and joining styles and scripts. I got this working and it is nice as expected :)

    However it seems that when I adding the ClientDependencyLoader control to the template, Canvas editing stops working. When starting canvas editing it gives an error related to some tinymce script:

    [NullReferenceException: The PathNameAlias specified for dependency tinymce3/tiny_mce_src.js does not exist in the ClientDependencyPathCollection]
    ClientDependency.Core.FileRegistration.Providers.BaseFileRegistrationProvider.UpdateFilePaths(IEnumerable`1 dependencies, HashSet`1 folderPaths) +355
    ClientDependency.Core.FileRegistration.Providers.WebFormsFileRegistrationProvider.RegisterDependencies(Control dependantControl, List`1 allDependencies, HashSet`1 paths) +40
    System.Collections.Generic.List`1.ForEach(Action`1 action) +64
    System.Web.UI.Control.PreRenderRecursiveInternal() +113

    When I remove the ClientDependencyLoader control things are working properly.
    Are there any solution for this? Some conditional addding?
    I guess this is related to Canvas adding it's own ClientDependencyLoader or similar, but I really don't know.

    Thank your for your assistance.

    Kind regards,
    Jesper

  • Shannon Deminick 1526 posts 5272 karma points MVP 3x
    Mar 02, 2011 @ 22:40
    Shannon Deminick
    0

    Hi,

    A ClientDependencyLoader can only exist in one request one time. So, when Canvas is loading it will create a ClientDependencyLoader if one doesn't exist already. In your case it will already exist because you have it registered on your template. The error you are receiving is because generally when Canvas registers it's own loader it also registers it's own shared paths with specific names and since you are not registering those specific PathNameAlias's its throwing an exception.

    Though i haven't tested this, you can try using the UmbracoClientDependencyLoader instead of the standard ClientDependencyLoader as it contains by default the PathNameAlias's that Umbraco/Canvas requires.

    This should be logged as a bug on CodePlex as well, please make sure you make a reference back to this URL.

    Let me know if that works/doesn't work.

Please Sign in or register to post replies

Write your reply to:

Draft