U4-2637 - Error adding a User using AD Membership Provider when no Email Address Defined

Created by Brady P. Merkel 16 Aug 2013, 18:55:32 Updated by Sebastiaan Janssen 19 Aug 2013, 08:42:37

After going through the setup steps at http://our.umbraco.org/wiki/how-tos/membership-providers/active-directory-membership-provider (successfuly by the way--my own account worked as per the instructions), I tried to login via a 2nd account that has no email address... and received this ASP.NET error:

Server Error in '/' Application.

Error running NonQuery: SQL Statement: insert into umbracoUser (UserType,startStructureId,startMediaId, UserName, userLogin, userPassword, userEmail,userLanguage) values (@type,-1,-1,@name,@lname,@pw,@email,@lang)

Exception: System.ArgumentNullException: Parameterized query expects a parameter value which was not supplied. Parameter name: @email at System.Data.SqlServerCe.SqlCeCommand.FillParameterDataBindings(Boolean verifyValue) at System.Data.SqlServerCe.SqlCeCommand.ExecuteCommand(CommandBehavior behavior, String method, ResultSetOptions options) at System.Data.SqlServerCe.SqlCeCommand.ExecuteNonQuery() at SqlCE4Umbraco.SqlCeApplicationBlock.ExecuteNonQuery(String connectionString, CommandType commandType, String commandText, SqlCeParameter[] commandParameters) Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: SqlCE4Umbraco.SqlCeProviderException: Error running NonQuery: SQL Statement: insert into umbracoUser (UserType,startStructureId,startMediaId, UserName, userLogin, userPassword, userEmail,userLanguage) values (@type,-1,-1,@name,@lname,@pw,@email,@lang)

Exception: System.ArgumentNullException: Parameterized query expects a parameter value which was not supplied. Parameter name: @email at System.Data.SqlServerCe.SqlCeCommand.FillParameterDataBindings(Boolean verifyValue) at System.Data.SqlServerCe.SqlCeCommand.ExecuteCommand(CommandBehavior behavior, String method, ResultSetOptions options) at System.Data.SqlServerCe.SqlCeCommand.ExecuteNonQuery() at SqlCE4Umbraco.SqlCeApplicationBlock.ExecuteNonQuery(String connectionString, CommandType commandType, String commandText, SqlCeParameter[] commandParameters)

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace: [SqlCeProviderException: Error running NonQuery: SQL Statement: insert into umbracoUser (UserType,startStructureId,startMediaId, UserName, userLogin, userPassword, userEmail,userLanguage) values (@type,-1,-1,@name,@lname,@pw,@email,@lang)

Exception: System.ArgumentNullException: Parameterized query expects a parameter value which was not supplied. Parameter name: @email at System.Data.SqlServerCe.SqlCeCommand.FillParameterDataBindings(Boolean verifyValue) at System.Data.SqlServerCe.SqlCeCommand.ExecuteCommand(CommandBehavior behavior, String method, ResultSetOptions options) at System.Data.SqlServerCe.SqlCeCommand.ExecuteNonQuery() at SqlCE4Umbraco.SqlCeApplicationBlock.ExecuteNonQuery(String connectionString, CommandType commandType, String commandText, SqlCeParameter[] commandParameters)] SqlCE4Umbraco.SqlCeApplicationBlock.ExecuteNonQuery(String connectionString, CommandType commandType, String commandText, SqlCeParameter[] commandParameters) +506 SqlCE4Umbraco.SqlCEHelper.ExecuteNonQuery(String commandText, SqlCeParameter[] parameters) +18 umbraco.DataLayer.SqlHelper`1.ExecuteNonQuery(String commandText, IParameter[] parameters) +81

[SqlHelperException: Umbraco Exception (DataLayer): SQL helper exception in ExecuteNonQuery] umbraco.DataLayer.SqlHelper`1.ExecuteNonQuery(String commandText, IParameter[] parameters) +201 umbraco.BusinessLogic.User.MakeNew(String name, String lname, String passw, String email, UserType ut) +294 umbraco.cms.presentation.login.ActiveDirectoryMapping(String loginName, String email) +50 umbraco.cms.presentation.login.Button1_Click(Object sender, EventArgs e) +362 System.Web.UI.WebControls.Button.OnClick(EventArgs e) +9554250 System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +103 System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +35 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1724

Comments

Sebastiaan Janssen 19 Aug 2013, 08:42:30

Fixed in revision f41d96786497551a5fffcb05f6e66563a8e93168


Priority: Normal

Type: Bug

State: Fixed

Assignee:

Difficulty: Normal

Category:

Backwards Compatible: True

Fix Submitted:

Affected versions:

Due in version: 6.1.4

Sprint:

Story Points:

Cycle: