Answers to annoying DNN problems

Posted June 26th, 2015 in Computers
DotNetNuke is an ASP.net framework similar to PHPNuke. As with all development, there are issues that arise which take a bit of searching for the answer. This page contains a list of problems faced when developing with the DNN framework.

Cannot save custom user roles for the FCK editor

Saving custom user roles for the FCK editor does not take. You select your options, click ''Apply'' but when you go back, the ''All users'' is still selected

Solution

An odd way to do things - BEFORE you click the ''Apply'' link, you MUST click the checkbox to the left of the option. This is the checkbox above the ''Cancel'' image for that option. Once you''ve done this with all options you want to change, click the ''Apply'' link. Strange - but it works.

How to hide the page control panel for some users

You want to hide the page control panel for some users, as sometimes you may want a logged in user to have access to editing the module but not the actual page controls

Solution

You need to set the control panel to be viewed by page editors only, and remove page edit permissions for the particular user role. Edit permissions are then set on the module, which allows the user to edit the module but not have the control panel available.

To set the permissions that hide the page control panel for some users:
  1. When logged in as SuperUser or Administrator, go to Admin/Site Settings

  2. Expand the ''Advanced Settings'' section, then the ''Usability Settings'' section

  3. For ''Control panel visibility'', choose ''Page editors''. Save using the ''update'' link

  4. Go to Admin/Pages. Select the page you wish to remove the control panel from

  5. Uncheck ''edit'' for the user role you wish to remove the control panel for. Save using the ''update'' link

  6. Navigate to the page you wish to remove the control panel for. In ''Design'' mode (selected from the top control panel), choose to edit the settings of the module for that page which the particular user role group will be editing. On the settings page, make sure this user role group has ''edit'' permissions as well as ''view'' permissions. Save using the ''update'' link

The user role group should not have the control panel displayed on the selected page. Do this for each page you need to hide the control panel on.

How to add a column with a default value to a table

You have an existing table that you want to add a column to, but it cannot be ''not null'' unless a default value is provided.

Solution

This is not a definitive guide for doing this, it is only an example of the syntax to use. To add a column with a default value to a table in DNN, use the following syntax:

alter table tablename ADD columname int DEFAULT 0 NOT NULL

In DotNetNuke, the ''Run as script'' checkbox needs to be checked.

How to retrieve information from SQL Server 2008

This is not a problem, rather it is a reference. Use the following queries to retrieve information from SQL Server 2008:

Getting the last modified date of a procedure

SELECT LAST_ALTERED, ROUTINE_NAME
FROM INFORMATION_SCHEMA.routines
ORDER BY LAST_ALTERED DESC

Getting the date the procedure was modified

SELECT CREATED, ROUTINE_NAME
FROM INFORMATION_SCHEMA.routines
ORDER BY CREATED DESC

View a procedure

SELECT routine_definition
FROM INFORMATION_SCHEMA.routines
where ROUTINE_NAME LIKE ''%something in the name of the procedure%''
ORDER BY CREATED DESC

View all prodecures

SELECT routine_definition
FROM INFORMATION_SCHEMA.routines
ORDER BY CREATED DESC
 

Comments

No comments

Leave a comment