DNN Forums

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

Unable to add module in DNN 9 > Fix

 2 Replies
 0 Subscribed to this topic
 30 Subscribed to this forum
Sort:
Author
Messages
Veteran Member
Posts: 1157
Veteran Member

    I'm just adding this post for others that might encounter the same issue in DNN.
    I have had issues on a DNN 9 site with adding modules in some circumstances.
    The issue was that after clicking the "Add Module" icon and selecting a module, I could not frag the module to the right Pane.
    Visually after selecting the module, I either saw an empty  square with a dashed / dotted border or
    a weird, half transparent preview of the placed module.
    But no way to drag the module.
    In the browser console you might see a Javascript error on $newModule.offset().

    Uncaught TypeError: $newModule.offset() is undefined
        _motionToNewModule https://mywebsite.com/Des...alog.js?cdv=380:1091
        _hideDialog https://mywebsite.com/Des...ialog.js?cdv=380:397
        jQuery 25
        _hideDialog https://mywebsite.com/Des...ialog.js?cdv=380:395
        close https://mywebsite.com/Des...Dialog.js?cdv=380:67
        _motionToNewModule https://mywebsite.com/Des...alog.js?cdv=380:1087
        _syncCompleteFunc https://mywebsite.com/Des...alog.js?cdv=380:1051
        _syncComplete https://mywebsite.com/Des...alog.js?cdv=380:1007
        setTimeout handler*_syncComplete https://mywebsite.com/Des...alog.js?cdv=380:1006
       ...
        dnnLoadScriptsInAjaxModeComplete https://mywebsite.com/Reports:1020
        loadScriptInSingleMode https://mywebsite.com/Reports:948
        https://mywebsite.com/Reports:1001
    ModuleDialog.js:1091:38

    I had the issue only on specific pages and found out it was caused by an HTML error (an extra < / div>) in the module that was already on the page.
    After I fixed the HTML error, placing modules worked correctly again.
    I did some tests and not all HTML errors seem to cause this issue.
    Also, an HTML error in your Theme might trigger the same issue.

    HTH Timo

    New Around Here
    Posts: 2
    New Around Here

      I also came across this error, but mine wasn't called by invalid HTML - I also found another solution, where if you have conflicting/invalid Site Aliases, it will also cause the Add Module function to fail. Removing the invalid site alias will return the hovering floating tile functionality.

      New Around Here
      Posts: 2
      New Around Here
        A bit more explanation: the website was unable to save the CEM_NewModuleId cookie because the JavaScript sf_siteRoot variable was invalid, because of this conflict. The Add Module functionality depends on the CEM_NewModuleId cookie in order to figure out which HTML element needs to be converted to "floating".

        Invalid sf_siteRoot: "//dnn.lcl" - the browser would not save the cookie and silently ignore this as this is not a matching or is an invalid domain.

        Valid sf_siteRoot: "/"

        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