DNN Forums

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

ModuleSearchBase problem

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

Hi,
I have a custom module I need to be searchable from DNN search.
So I have added a Controller class to my module that extends ModuleSearchBase with GetModifiedSearchDocuments method. I added the namespace in the module settings.
However since I added the namespace the module crashes and throws this exception the log:
Value cannot be null. Parameter name: type
InnerStackTrace:
in System.Activator.CreateInstance(Type type, Boolean nonPublic) in System.Activator.CreateInstance(Type type) in DotNetNuke.UI.Skins.Pane.IsVesionableModule(ModuleInfo moduleInfo) in DotNetNuke.UI.Skins.Pane.InjectModule(ModuleInfo module) in DotNetNuke.UI.Skins.Skin.InjectModule(Pane pane, ModuleInfo module)

this is my controller class:
 

    public class ListaController : ModuleSearchBase
    {
        public ListaController()
        {
        }

        public override IList GetModifiedSearchDocuments(ModuleInfo modInfo, DateTime beginDate)
        {
            var searchDocuments = new List();
            List docs = GetDocs();

            foreach (var doc in docs)
            {
                searchDocuments.Add(new SearchDocument
                {
                    Title = doc.Title,
                    Body = doc.Body,
                    ... and so on ...
                });
            }

            return searchDocuments;
        }
}

I think the problem is in the configuration side rather than code side.

DNN version is 9.4.0.

Can you help me? Thanks in advance!

Veteran Member
Posts: 1246
Veteran Member
MVP
MVP
You're an MVP!
If you want an example of implementing search in a module, take a look at christoc.com for his module templates.

You may find some other details at https://www.dnndocs.com/index.html
Growing Member
Posts: 55
Growing Member
MVP
MVP
You're an MVP!
I hate it when I come to a forum post to find an answer and it points to my projects, which don't answer the question :D

I'll be updating my Module Development templates to support ModuleSearchBase very soon!!!!!!!!!!!
Growing Member
Posts: 55
Growing Member
MVP
MVP
You're an MVP!
I love it even more when I go into the Templates and find they already support ModuleSearchBase...

Joe Craig is right again!
Senior Member
Posts: 1607
Senior Member
MVP
MVP
You're an MVP!
New Poster
New Poster
Congrats on posting!

Things have come full circle for Hammond! 🤣 

Veteran Member
Posts: 360
Veteran Member
Helpful Replier
Helpful Replier
Thanks for being such a helpful replier!
MVP
MVP
You're an MVP!
Thanks for the entertaining post - you gotta love it when you run into a situation where your former self knew something you currently don't know! LOL

David Poindexter


Creator:


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