Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeOur CommunityOur CommunityCommunity Membe...Community Membe...DotNetNuke 3.3.5/4.3.5 Public ReleaseDotNetNuke 3.3.5/4.3.5 Public Release
Previous
 
Next
New Post
10/3/2006 11:51 PM
 

Note re DNN-3706: The fix in DNN 4.3.5 is only a "partial" fix of the ValidationExpression problem in Profile Definitions.

I have posted the bug to the public Gemini, and am re-producing the details of it here. I hope to get a closer look at the "why", as a functioning ValidationExpression is a required use case for a client of mine.


DNNP-4205

The issue DNN-3706 that was "fixed" in DNN 4.3.5 is only "partially" fixed.

(Added Note: While this bug is rated as "Minor", it does produce an exception when attempting to edit user profiles and may be considered "Major" for some use cases where profile validation is deemed essential.)



While the ValidationExpression column in the ProfilePropertyDefinition is indeed expanded to 2000 characters (from 100) as per DNN-3706, attempting to store a ValidationExpression via the Add/Edit Profile Property admin page only stores the first 100 characters.

How to reproduce:
1) Fresh DNN4.3.5 install
2) Add profile property "Birthdate" with a datatype Text and length 10, make it required and visible, and...
3) Set the ValidationExpression in the form to the following:
(^((((0[1-9])|([1-2][0-9])|(3[0-1]))|([1-9]))\x2F(((0[1-9])|(1[0-2]))|([1-9]))\x2F(([0-9]{2})|(((19)|([2]([0]{1})))([0-9]{2}))))$)

It will truncate at 100 characters to store in the db table as this value:
(^((((0[1-9])|([1-2][0-9])|(3[0-1]))|([1-9]))\x2F(((0[1-9])|(1[0-2]))|([1-9]))\x2F(([0-9]{2})|(((19)

This validation expression is to ensure that a valid date is entered between 1/1/1900 to 31/12/2099 (as taken from regexlib.com).

This truncated value will prevent any attempt to edit a user's profile with the following exception details:



AssemblyVersion: 04.03.05
PortalID: 0
PortalName: My Website
UserID: 1
UserName: host
ActiveTabID: 42
ActiveTabName: User Accounts
RawURL: /435Install/Admin/UserAccounts/tabid/42/ctl/Edit/mid/357/UserId/2/Default.aspx
AbsoluteURL: /435Install/Default.aspx
AbsoluteURLReferrer: http://localhost/435Install/Admin/UserAccounts/tabid/42/ctl/Edit/mid/357/UserId/2/Default.aspx
UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; InfoPath.2)
DefaultDataProvider: DotNetNuke.Data.SqlDataProvider, DotNetNuke.SqlDataProvider
ExceptionGUID: 0be5e0e8-f7dd-447b-84b5-d7026c641fea
InnerException: (^((((0[1-9])|([1-2][0-9])|(3[0-1]))|([1-9]))\x2F(((0[1-9])|(1[0-2]))|([1-9]))\x2F(([0-9]{2})|(((19) is not a valid regular expression.
FileName:
FileLineNumber: 0
FileColumnNumber: 0
Method: System.Text.RegularExpressions.RegexParser.ScanRegex
StackTrace:
Message: DotNetNuke.Services.Exceptions.PageLoadException: (^((((0[1-9])|([1-2][0-9])|(3[0-1]))|([1-9]))\x2F(((0[1-9])|(1[0-2]))|([1-9]))\x2F(([0-9]{2})|(((19) is not a valid regular expression. ---> System.Web.HttpException: (^((((0[1-9])|([1-2][0-9])|(3[0-1]))|([1-9]))\x2F(((0[1-9])|(1[0-2]))|([1-9]))\x2F(([0-9]{2})|(((19) is not a valid regular expression. ---> System.ArgumentException: parsing "(^((((0[1-9])|([1-2][0-9])|(3[0-1]))|([1-9]))\x2F(((0[1-9])|(1[0-2]))|([1-9]))\x2F(([0-9]{2})|(((19)" - Not enough )'s. at System.Text.RegularExpressions.RegexParser.ScanRegex() at System.Text.RegularExpressions.RegexParser.Parse(String re, RegexOptions op) at System.Text.RegularExpressions.Regex..ctor(String pattern, RegexOptions options, Boolean useCache) at System.Text.RegularExpressions.Regex.IsMatch(String input, String pattern) at System.Web.UI.WebControls.RegularExpressionValidator.set_ValidationExpression(String value) --- End of inner exception stack trace --- at System.Web.UI.WebControls.RegularExpressionValidator.set_ValidationExpression(String value) at DotNetNuke.UI.WebControls.FieldEditorControl.BuildValidators(EditorInfo editInfo, String targetId) at DotNetNuke.UI.WebControls.FieldEditorControl.BuildDiv(EditorInfo editInfo) at DotNetNuke.UI.WebControls.FieldEditorControl.CreateEditor() at DotNetNuke.UI.WebControls.FieldEditorControl.DataBind() at DotNetNuke.UI.WebControls.PropertyEditorControl.AddEditorRow(Table& tbl, String name, IEditorInfoAdapter adapter) at DotNetNuke.UI.WebControls.CollectionEditorControl.AddEditorRow(Table& tbl, Object obj) at DotNetNuke.UI.WebControls.PropertyEditorControl.CreateEditor() at DotNetNuke.UI.WebControls.ProfileEditorControl.CreateEditor() at DotNetNuke.UI.WebControls.PropertyEditorControl.DataBind() at DotNetNuke.Modules.Admin.Users.Profile.DataBind() at DotNetNuke.Modules.Admin.Users.ManageUsers.ShowPanel() at DotNetNuke.Modules.Admin.Users.ManageUsers.cmdProfile_Click(Object sender, EventArgs e) at DotNetNuke.UI.WebControls.CommandButton.RaiseClick(Object sender, EventArgs e) at System.Web.UI.WebControls.LinkButton.OnClick(EventArgs e) at System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument) at System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) --- End of inner exception stack trace ---
Source:
Server Name: DG-NX01


 

 
New Post
10/5/2006 9:03 AM
 

Here's the fix. Quite simple, really. In DNN 4.3.5 (and 3.3.5) the following Add/Update stored procedures needed their @ValidationExpression parameter set to 2000 characters (from 100).

Here's the "patch" script:


/* Fix AddPropertyDefinition */

/********************************/

IF EXISTS ( SELECT * FROM sysobjects WHERE id = object_id(N'{databaseOwner}{objectQualifier}AddPropertyDefinition') AND OBJECTPROPERTY(id, N'IsProcedure') = 1)

DROP PROCEDURE {databaseOwner}{objectQualifier}AddPropertyDefinition

GO

CREATE PROCEDURE {databaseOwner}{objectQualifier}AddPropertyDefinition

@PortalId int,

@ModuleDefId int,

@DataType int,

@DefaultValue nvarchar(50),

@PropertyCategory nvarchar(50),

@PropertyName nvarchar(50),

@Required bit,

@ValidationExpression nvarchar(2000),

@ViewOrder int,

@Visible bit,

@Length int

AS

DECLARE @PropertyDefinitionId int

SELECT @PropertyDefinitionId = PropertyDefinitionId

FROM {objectQualifier}ProfilePropertyDefinition

WHERE (PortalId = @PortalId OR (PortalId IS NULL AND @PortalId IS NULL))

AND PropertyName = @PropertyName

IF @PropertyDefinitionId is null

BEGIN

INSERT {objectQualifier}ProfilePropertyDefinition (

PortalId,

ModuleDefId,

Deleted,

DataType,

DefaultValue,

PropertyCategory,

PropertyName,

Required,

ValidationExpression,

ViewOrder,

Visible,

Length

)

VALUES (

@PortalId,

@ModuleDefId,

0,

@DataType,

@DefaultValue,

@PropertyCategory,

@PropertyName,

@Required,

@ValidationExpression,

@ViewOrder,

@Visible,

@Length

)

SELECT @PropertyDefinitionId = SCOPE_IDENTITY()

END

ELSE

BEGIN

UPDATE {objectQualifier}ProfilePropertyDefinition

SET DataType = @DataType,

ModuleDefId = @ModuleDefId,

DefaultValue = @DefaultValue,

PropertyCategory = @PropertyCategory,

Required = @Required,

ValidationExpression = @ValidationExpression,

ViewOrder = @ViewOrder,

Deleted = 0,

Visible = @Visible,

Length = @Length

WHERE PropertyDefinitionId = @PropertyDefinitionId

END

SELECT @PropertyDefinitionId

GO

/* Fix Update Property Definition Stored Procedures */

/****************************************************/

if exists (select * from dbo.sysobjects where id = object_id(N'{databaseOwner}[{objectQualifier}UpdatePropertyDefinition]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)

DROP PROCEDURE {databaseOwner}[{objectQualifier}UpdatePropertyDefinition]

GO

CREATE PROCEDURE {databaseOwner}[{objectQualifier}UpdatePropertyDefinition]

@PropertyDefinitionId int,

@DataType int,

@DefaultValue nvarchar(50),

@PropertyCategory nvarchar(50),

@PropertyName nvarchar(50),

@Required bit,

@ValidationExpression nvarchar(2000),

@ViewOrder int,

@Visible bit,

@Length int

as

UPDATE {databaseOwner}{objectQualifier}ProfilePropertyDefinition

SET DataType = @DataType,

DefaultValue = @DefaultValue,

PropertyCategory = @PropertyCategory,

PropertyName = @PropertyName,

Required = @Required,

ValidationExpression = @ValidationExpression,

ViewOrder = @ViewOrder,

Visible = @Visible,

Length = @Length

WHERE PropertyDefinitionId = @PropertyDefinitionId

GO

 

 
New Post
10/5/2006 4:11 PM
 
Ty for the solution script, however all dnn 4.3.5 users need this?



Or-Rouge Team Or-Rouge
Personally recommend Hostgator for hosting single or multiple DotNetNuke Websites.
DotNetNuke Tips and Tutorials
Install DotNetNuke to Godaddy root
DotNetNuke Türkçe Hakkinda Hersey
 
New Post
8/4/2008 8:06 AM
 
Hi, not sure who I should report this too but I have just installed v 4.8.4 and noticed encountered this problem. After a little investigation I narrowed down the the fact that the AddPropertyDefinition stored procedured has been changed to allow a max of 2000 characters for a validation expression. However, the UpdatePropertyDefinition stored procedure had not. I have done this manually on my own DNN installation and it fixes the problem. It obviously needs to be addressed for future releases. Hope that helps someone...
 
New Post
8/4/2008 11:59 PM
 

Create an account here: http://support.dotnetnuke.com/Main.aspx

Then add a new issue in the section labeled: ** DNN Core Framework and Modules [ PUBLIC ] ** (DNNP)

Try and be specific about the details and hopefully it'll get checked and picked up.

Rob

 
Previous
 
Next
HomeHomeOur CommunityOur CommunityCommunity Membe...Community Membe...DotNetNuke 3.3.5/4.3.5 Public ReleaseDotNetNuke 3.3.5/4.3.5 Public Release


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. 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.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out