DNN Forums

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

modulecontroller.getmodulesettings(int) deprecated

 5 Replies
 1 Subscribed to this topic
 26 Subscribed to this forum
Sort:
Author
Messages
New Around Here
Posts: 14
New Around Here

Dear DNN Guru

Recently I develop a module for Dnn 8.0.4. I want to get other modules data, so that I use "modulecontroller.getmodulesettings(ModuleId)" . This "ModuleId" is other Module's ID.

But When I Debug the Mogule, I got modulecontroller.getmodulesettings(int) deprecated in DNN 7.3.  I am not sure what the API in new DNN should be use.  Please help me !  Thanks in advance !

Jimmy

Veteran Member
Posts: 1182
Veteran Member
MVP
MVP
You're an MVP!

Jimmy,

I am not a guru, but the "new" way is this:

<code>ModuleInfo module = ModuleController.Instance.GetModule(int moduleId, int tabId, bool ignoreCache);<br /> Hashtable settings = module.ModuleSettings;</code>

Happy DNNing!
Michael

Michael Tobisch
DNN★MVP

DNN Connect
Veteran Member
Posts: 1246
Veteran Member
MVP
MVP
You're an MVP!
You are using DNN 9.0.4?
New Around Here
Posts: 14
New Around Here

Dear Michael

Thank you very much !  I will try it as your instructions. 

Thanks again!

Jimmy

New Around Here
Posts: 14
New Around Here

Dear Craig

I am using DNN 8.0.4 to develop a module.

Thanks!

Jimmy

Veteran Member
Posts: 1246
Veteran Member
MVP
MVP
You're an MVP!
OK, note that the message is a warning, not an error. Deprecated means that the API works in 8.0.4, but that there is a more modern one, the one that Michael (though I didn't check it).

In the DNN 9.x releases, many (LOTS!) of deprecated APIs are removed and only the supported ones will remain. You can check but I think that this starts happening at 9.3.2 or around there. Read the release notes.

So, the bottom line is that your module should work as written, but now is a good time to replace deprecated APIs with those that aren't deprecated. That way you'll not have problems going forward.

Also, if this module is not installed as a compiled module it's a good time to do that, too!

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