DNN (dotnetnuke) Active Forum Module Control Panel a critical error has occurred

Error when opening the DNN Active Forum Module Control Panel

When you attempt to open the forum module Control Panel, you receive a.net load error that says a critical error has occurred. Upon looking at the log files for the website within DNN, you’ll notice that the related error message looks something like this.

bsoluteURL:/Default.aspx
DefaultDataProvider:DotNetNuke.Data.SqlDataProvider, DotNetNuke
ExceptionGUID:1012073d-d31d-4a73-a051-31478c9de05d
AssemblyVersion:7.4.0
PortalId:0
UserId:3429
TabId:107
RawUrl:/Resources/Forum/ctl/EDIT/mid/506
Referrer:http://website.com.au/Resources/Forum
UserAgent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/600.6.3 (KHTML, like Gecko) Version/8.0.6 Safari/600.6.3
ExceptionHash:eUa1nHF8hNveOCQzqX0zOg==
Message:Object reference not set to an instance of an object.
StackTrace:
InnerMessage:Object reference not set to an instance of an object.
InnerStackTrace:
at DotNetNuke.Modules.ActiveForums.Controls.Callback.OnLoad(EventArgs e)
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
Source:
FileName:
FileLineNumber:0
FileColumnNumber:0
Method:
Server Name: SERVERNAME

 

The Fix

It is good practice to ensure that you have the latest version of the DotNetNuke forum module on your website. Especially if you are using the later versions of DNN.  Currently the module project has been moved into an open source project on GitHub. The latest version can be found here: https://github.com/ActiveForums/ActiveForums

 

 fixing the error

 you need to ensure that the web.config file also includes the following reference.

        <section name=”cryptography” requirePermission=”false” type=”DotNetNuke.Framework.Providers.ProviderConfigurationHandler, DotNetNuke” />

 

 

    <cryptography defaultProvider=”CoreCryptographyProvider”>

      <providers>

        <clear />

        <add name=”CoreCryptographyProvider” type=”DotNetNuke.Services.Cryptography.CoreCryptographyProvider, DotNetNuke” providerPath=”~\Providers\CryptographyProviders\CoreCryptographyProvider\” />

      </providers>

    </cryptography>


 Take note of where this is found in the web can feed file below.

Screenshot 2015 06 27 17 13 53

 

 

Google Analytics API Access V3

Accessing your Google Analytic Data via API

To allow a third party module or application to view and display your Google Analytics data for your website. You need to get a few things organised.

1. You need to have a Google Analytic account with your website registered.

Go to: http://www.google.com/analytics/   and follow their instructions to set up your URL under an account that you can manage and access with Admin permissions. We are not going to go through these steps here as it is a given that you will have this. Seek help from Google if you can’t manage.

 

2. Set up an API for your Google Analytics Account at the Google Developers Portal.

Go to: https://developers.google.com/  and login with your account.

To get started using Google Analytics API, you need to first create or select a project in the Google Developers Console and enable the API. Using this link guides you through the process and activates the Google Analytics API automatically.

Alternatively, you can activate the Google Analytics API yourself in the Developers Console by doing the following:

  1. Go to the Google Developers Console.
  2. Select a project, or create a new one.
  3. In the sidebar on the left, expand APIs & auth. Next, click APIs. Select the Enabled APIs link in the API section to see a list of all your enabled APIs. Make sure that the Google Analytics API is on the list of enabled APIs. If you have not enabled it, select the API from the list of APIs, then select the Enable API button for the API.
     Screenshot 2015 07 07 00 53 20
  4. In the sidebar on the left, select Credentials.
     Screenshot 2015 07 07 00 54 06

In either case, you end up on the Credentials page and can create your project’s credentials from here.

Create a client ID

From the Credentials page, click Create new Client ID under the OAuth heading to create your OAuth 2.0 credentials.

  1. For the APPLICATION TYPE select Service account.
  2. Click Create Client ID.
  3. For the KEY TYPE select P12 key. (The system will download a .P12 file. You will need this file to upload to the module)
  4. A dialog box appears. To proceed, click Okay, got it.

 

3. Add service account to Google Analytics account

The newly created service account will have an email address, <projectId>-<uniqueId>@developer.gserviceaccount.com; Use this email address to add a user to the Google analytics account you want to access via the API. For this tutorial only Read & Analyzepermissions are needed.

Select User Management (in the Analytics Admin)

Screenshot 2015 07 07 00 49 39

Enter the weird email address from the API credentials step above to give Read & Analyze permissions.

Screenshot 2015 07 07 00 51 16

 

In Summary

  1. You have created a Google Developer Account.
  2. Created an API and Given Permission to “Analytics API”
  3. You have Downloaded a P12 Credentials file.
  4. You have Authorised the associated weird google email address from the P12 account to have read permissions on your Analytics Account.

If you get all that right, then the module we use, will work to access your Google Analytics data from within your module.

 

DNN Blog Module 404 Error on Reading Post

When using DNN Blog Module you receive 404 page cannot be found error

The symptoms of this are fairly easy. When you click on the Read more link or the title of a blog that would normally take you to the full article of the blog. The page instead displays a 404 error.

DNN Blog 404

 If you explore the URL you will find that the URL references the blog title something like this: http://canopi.com.au/Blog/Post/355/Single-Server-Sign-On-SSO-Part-1 

 take note that the URL does not end with the .aspx

 

The Cause

The URL of the blog post is being rewritten through the friendly URL settings within the later versions of DNN.

 DNN Friendly URL Settings

 the friendly URL settings can be found within: HOST /  ADVANCED SETTINGS / FRIENDLY URL SETTINGS

 and by default in the later versions of DNN are enabled.  The problem arises when the web.config file is missing a setting for the advanced URL rewriting.

 

 The Fix

 the fix is very easy and involves editing  the web.config file.

1. Take a backup of the web.config file for your site
2. Open the web.config file, and search for ‘urlformat’. You should find this in the section, like this:


<add name="DNNFriendlyUrl" type="DotNetNuke.Services.Url.FriendlyUrl.DNNFriendlyUrlProvider, DotNetNuke.HttpModules" includePageName="true" regexMatch="[^a-zA-Z0-9 _-]" urlFormat="humanfriendly" />

 

3. Change the urlFormat value to ‘advanced’, like this:


<add name="DNNFriendlyUrl" type="DotNetNuke.Services.Url.FriendlyUrl.DNNFriendlyUrlProvider, DotNetNuke.HttpModules" includePageName="true" regexMatch="[^a-zA-Z0-9 _-]" urlFormat="advanced" />

A Common SMTP Error in DotNetNuke

We get help requests, and we really do love to help you! Really! but please make sure you have a DNN host SMTP server configured that works before you ask us for help! 
This module requires the SMTP server settings to be configure in DNN. This is because it uses the DNN SMTP server settings to send email. To configure…

1) Login as host user
2) Under “Host” menu select “Host Settings”
3) Scroll down and expand “Advanced Settings”
4) Expand “SMTP Server Settings”
5) In the SMTP Server text box type in mail.your_domain.com where your_domain.com is the actual domain name of your site (this same exact host name for smtp, pop3, imap4, and web mail)

You can use authentication for the SMTP server if required. The DNN site will require Relay permissions that are often set to require authentication.

An example of the error you see when you do not have this configured correctly is.

Error: Email Enquiry is currently unavailable.
DotNetNuke.Services.Exceptions.ModuleLoadException: Object reference not set to an instance of an object. —> System.NullReferenceException: Object reference not set to an instance of an object. at DotNetNuke.Services.Mail.Mail.SendMail(String MailFrom, String MailTo, String Cc, String Bcc, MailPriority Priority, String Subject, MailFormat BodyFormat, Encoding BodyEncoding, String Body, String Attachment, String SMTPServer, String SMTPAuthentication, String SMTPUsername, String SMTPPassword, Boolean SMTPEnableSSL) at DotNetNuke.Services.Mail.Mail.SendMail(String MailFrom, String MailTo, String Cc, String Bcc, MailPriority Priority, String Subject, MailFormat BodyFormat, Encoding BodyEncoding, String Body, String Attachment, String SMTPServer, String SMTPAuthentication, String SMTPUsername, String SMTPPassword) at iwebs.Modules.CFD.CFD.doSend() — End of inner exception stack trace —

Understanding SMTP in DotNetNuke

DNN SMTP Settings

DNN Websites have the ability to configure in the host settings an SMTP server. When a DNN email is generated from the DNN website, it will attempt to send mail through this SMTP server.

In order that your DNN website can successfully send the email, the SMTP server must allow the email message to be received. Typically this is done in one of four ways.

  1. The SMTP server is configured for Open Relay (This should NEVER be done unless you have an external firewall blocking all external SMTP connections. Otherwise your mail server will become a spam server within hours)

  2. SMTP Authentication – Typically SMTP servers are configured to allow users with a valid username and password to authenticate themselves. Once they have been authenticated, they can communicate email messages through the SMTP server. This is the same way most ISP’s work their mail servers. The idea is that only users who are customers of the ISP will allow email to be sent from their SMTP servers.

  3. Selective Open Relay. The administrator of the SMTP server can also allow Open Relay (same as 1 above) from selective IP addresses. Any communication from an IP address that is configured to allow open relay will be accepted by the SMTP server.

  4. Local Host – If your website has it’s own SMTP server configured, typically it will allow email message to be sent form it’s self.

To correctly configure your DNN SMTP settings, you need to understand what method of communication has been configured in the SMTP server you are trying to set DNN to access.

Here is the process you would configure from above.

  1. Enter the IP address or valid domain name for the SMTP server, nothing more to do if open relay is allowed. (Still not recommended)

  2. Enter the IP address or valid domain name for the SMTP server, and the valid user name and password as would be used to communicate with the SMTP server. This is where you get to use the user name and password setting in DNN.

  3. Ensure that the SMTP administrator has allowed the IP address your DNN website uses to have open relay status. Then just enter the IP address or domain name of the SMTP server in your DNN host settings.

  4. Configure your DNN host settings to have “localhost” in the DNN SMTP server settings are.

Problems.
There can be some issues that get confusing with the different methods.

  1. Open relay mail servers will be attacked by spammers very quickly. They are always on the lookout for mail servers that they can abuse. It is never recommended to have your mail server on the internet and in open relay. Additionally your mail server will be blacklisted by other mail servers if found to be in open relay.

  2. SMTP Authentication  can still be restricted to certain IP addresses. Many ISP’s will allow you only to use their mail servers while you are a client of their AND connecting to their mail server from an IP address they own. So thing will work in your Email applications while you are connecting to the internet via their dialup or high speed connection, but as soon as you move away from a connection provided by them, you will not be allows to connect to their servers, let alone Authenticate.

  3. Even if your ISP has allowed relay from the address that your mail server is run form, there may be a firewall or block on the normal port that the SMTP servers are typically configured to use. Port 25. If a firewall exists between your web server and the mail server, it must be configured to allow traffic over port 25.

  4. You may have web server configured with an SMTP server on the same system. Yet have it be blocked over port 25 for outbound communications. Some ISP’s block port 25 to curb the flow of virus email messages. You need to be sure that your ISP that provides connection to the internet for your web and SMTP server is not blocking port 25.

How to get really confused.
Often mail servers will allow you to send email messages to email addresses on that SMTP server, even though they do not allow you to send mail out. So if you have a web application configured to send email to yourself, and the SMTP settings you use in the DNN host settings are for the SMTP server that runs the same email address you will have success.
Yet when you change the email address in the web application, you can no longer send email, and the web application appears to fail. This is still an SMTP configuration error on your website. You will need to find a method above to solve the issue.