DNN Forums

Ask questions about your website to get help learning DNN and help resolve issues.

DependencyProvider in subclass of ModuleSearchBase

 12 Replies
 3 Subscribed to this topic
 26 Subscribed to this forum
Sort:
Page 1 of 212 > >>
Author
Messages
New Around Here
Posts: 1
New Around Here

Hi everyone,

Globals.NavigateURL has been deprecated, but it's currently not possible to resolve a dependency on NavigationManager in a subclass of ModuleSearchBase. DependencyProvider does not exist in the context. Am I missing something or this is a feature that still needs to be implemented?

Kinds regards,

Derek

Advanced Member
Posts: 159
Advanced Member
MVP
MVP
You're an MVP!
This does still need to be implemented. Thanks!
New Around Here
Posts: 3
New Around Here

Is this issue resolved in version 9.13.9?

Veteran Member
Posts: 349
Veteran Member
3 Helpful Replier
Helpful Replier
Thanks for being such a helpful replier!
MVP
MVP
You're an MVP!
Engaged Reader
Engaged Reader
You are an engaged reader!
Avid Reader
Avid Reader
Avid Reader art thou!
No, constructor injection in those was implemented in DNN10, I replied on https://dnncommunity.org/...ulesearchbase/#14117 if you need a workaround in the meantime.
Advanced Member
Posts: 233
Advanced Member
4 Helpful Replier
Helpful Replier
Thanks for being such a helpful replier!
New Poster
New Poster
Congrats on posting!
4 Engaged Reader
Engaged Reader
You are an engaged reader!

I am trying to understand what needs to be done here in order to "future-proof" this future breaking change ...

 

Advanced Member
Posts: 159
Advanced Member
MVP
MVP
You're an MVP!
  • Accepted Answer

I've submitted a PR with an example of a way to resolve this particular scenario.

I would approach this by introducing a constructor which will be used in DNN 10 that has an <code>IPortalAliasService</code> parameter. For DNN 9, continue using a parameterless constructor and pass an <code>IPortalAliasService</code> instance to the new constructor. That part could look like this:

<code>private readonly IPortalAliasService portalAliasService;

public TopicsController()
    : this(new DotNetNuke.Entities.Portals.PortalAliasController())
{
}

public TopicsController(IPortalAliasService portalAliasService)
{
    this.portalAliasService = portalAliasService;
}
</code>
Advanced Member
Posts: 233
Advanced Member
4 Helpful Replier
Helpful Replier
Thanks for being such a helpful replier!
New Poster
New Poster
Congrats on posting!
4 Engaged Reader
Engaged Reader
You are an engaged reader!
Posted By Brian Dukes on 1/12/2026 3:48 PM

For DNN 9, continue using a parameterless constructor and pass an <code>IPortalAliasService</code> instance to the new constructor.

 

Thanks Brian...you rock! smiley

 

 

Advanced Member
Posts: 233
Advanced Member
4 Helpful Replier
Helpful Replier
Thanks for being such a helpful replier!
New Poster
New Poster
Congrats on posting!
4 Engaged Reader
Engaged Reader
You are an engaged reader!
Posted By Brian Dukes on 1/12/2026 3:48 PM

 

I would approach this by introducing a constructor which will be used in DNN 10 that has an <code>IPortalAliasService</code> parameter.

Hi Brian. Wanted to see if you can help clarify this statement "... a constructor which will be used in DNN 10 ... ". The constructor here is "TopicsController", which implements ModuleSearchBase. Are you saying that DNN 10 will change the constructor instantiation for the controller that implements ModuleSearchBase to include IPortalAliasService? Or that it's the "businessControllerClass" for the module? Or that something else in DNN 10 that will affect any constructor that is called with a parameter of IPortalAliasService?

 

 

Advanced Member
Posts: 159
Advanced Member
MVP
MVP
You're an MVP!

Starting in DNN 10, the business controller class supports constructor injection (<code>ModuleSearchBase</code> is a base class for the business controller class, in addition to the interfaces like <code>IUpgradeable</code> and <code>IPortable</code>). So, any constructor parameter in the class will be automatically provided by the Dependency Injection container (assuming it's registered with the container). Does that answer what you're asking?

Advanced Member
Posts: 233
Advanced Member
4 Helpful Replier
Helpful Replier
Thanks for being such a helpful replier!
New Poster
New Poster
Congrats on posting!
4 Engaged Reader
Engaged Reader
You are an engaged reader!
Posted By Brian Dukes on 2/26/2026 9:40 AM

Starting in DNN 10, the business controller class supports constructor injection (<code>ModuleSearchBase</code> is a base class for the business controller class, in addition to the interfaces like <code>IUpgradeable</code> and <code>IPortable</code>). So, any constructor parameter in the class will be automatically provided by the Dependency Injection container (assuming it's registered with the container). Does that answer what you're asking?

Perfect! Thanks for your answer.

 

Page 1 of 212 > >>

These Forums are for the discussion of the open source CMS DNN platform and ecosystem.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. If you have (suspected) security issues, please DO NOT post them in the forums but instead follow the official DNN security policy
  2. No Advertising. This includes the promotion of commercial and non-commercial products or services which are not directly related to DNN.
  3. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  4. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  5. No Flaming or Trolling.
  6. No Profanity, Racism, or Prejudice.
  7. Site Moderators have the final word on approving / removing a thread or post or comment.
  8. English language posting only, please.

Would you like to help us?

Awesome! Simply post in the forums using the link below and we'll get you started.

Get Involved