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.
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.
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:
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
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.
is working on a reply...