DNN Forums

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

ModuleSearchBase problem

Sort:
You are not authorized to post a reply.





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





      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
      Joe Craig
      DNN MVP
      Patapsco Research Group





      Growing Member





        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!!!!!!!!!!!
        Chris Hammond Christoc.com Software Solutions
        DNN since before it was DNN!
        Open Source Projects and Tutorials since 2003





        Growing Member





          I love it even more when I go into the Templates and find they already support ModuleSearchBase...

          Joe Craig is right again!
          Chris Hammond Christoc.com Software Solutions
          DNN since before it was DNN!
          Open Source Projects and Tutorials since 2003





          Veteran Member





            Things have come full circle for Hammond! 🤣 






            Advanced Member





              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
              Corporate Website  |  Facebook Page  |  Twitter Page

              nvisionative
              Creator of:
              You are not authorized to post a reply.

              These Forums are dedicated to the discussion of DNN Platform.

              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