Dnn.Platform
Dnn.Platform copied to clipboard
[Bug]: The Client Resource Exclude Controls don't always work
Is there an existing issue for this?
- [x] I have searched the existing issues
What happened?
We have two mechanisms of adding client dependencies:
- Through a webforms control like DnnCssInclude
- Programmatically through the ClientResourceManager
We also have two controls to remove a client dependency: DnnCssExclude and DnnJsExclude. These are supposed to remove these if they were added by "someone else" (another vendor or the framework). But here's the thing:
- The webforms controls get the resources injected into the three designated areas: PageHeader, Body or FormBottom.
- The ClientDependencyManager injects the resources into the ClientResourceIncludes control
- The Exclude controls try to delete their named resource just from the ClientResourceIncludes control
So if your resource was added using the Webforms control, it will not be removed through the webforms control.
I plan to address this issue in my work to resolve #6643
Steps to reproduce?
- Create a webforms module
- Add a script with the webforms control and give it a name and version
- Add an exclude control that targets that name
- Watch the script still be rendered
BTW this example is obviously not something a sane developer would do, but it illustrates the point.
Current Behavior
No response
Expected Behavior
No response
Relevant log output
Anything else?
No response
Affected Versions
Current development branch (unreleased)
What browsers are you seeing the problem on?
No response
Code of Conduct
- [x] I agree to follow this project's Code of Conduct