Dnn.Platform icon indicating copy to clipboard operation
Dnn.Platform copied to clipboard

[Bug]: The Client Resource Exclude Controls don't always work

Open donker opened this issue 3 months ago • 0 comments

Is there an existing issue for this?

  • [x] I have searched the existing issues

What happened?

We have two mechanisms of adding client dependencies:

  1. Through a webforms control like DnnCssInclude
  2. 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:

  1. The webforms controls get the resources injected into the three designated areas: PageHeader, Body or FormBottom.
  2. The ClientDependencyManager injects the resources into the ClientResourceIncludes control
  3. 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?

  1. Create a webforms module
  2. Add a script with the webforms control and give it a name and version
  3. Add an exclude control that targets that name
  4. 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

donker avatar Sep 11 '25 18:09 donker