I have installed v2.2 Beta on a fairly clean Umbraco v4.7 install, but whenever I try to create a Data Type using the new "DataType Grid", I get the following error:
Object reference not set to an instance of an object.
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: System.NullReferenceException: Object reference not set to an instance of an object.
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:
[NullReferenceException: Object reference not set to an instance of an object.]
uComponents.Core.DataTypes.DataTypeGrid.DtgPrevalueEditor.Save() +96
umbraco.cms.presentation.developer.editDatatype.save_click(Object sender, ImageClickEventArgs e) +31
System.Web.UI.WebControls.ImageButton.OnClick(ImageClickEventArgs e) +115
System.Web.UI.WebControls.ImageButton.RaisePostBackEvent(String eventArgument) +120
System.Web.UI.WebControls.ImageButton.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) +36
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5563
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1
I downloaded the zip file and extracted the contents to the Bin folder. I restarted the App Pool in IIS and logged on, when I tried to create the DataTaype I got this
[NullReferenceException: Object reference not set to an instance of an object.]
uComponents.Core.DataTypes.DataTypeGrid.DtgPrevalueEditor.Save() in C:\Users\ovea\Documents\Visual Studio 2010\Projects\uComponents\umbdatatypes\branches\v2.0\uComponents.Core\DataTypes\DataTypeGrid\DTG_PrevalueEditor.cs:124
umbraco.cms.presentation.developer.editDatatype.save_click(Object sender, ImageClickEventArgs e) +31
System.Web.UI.WebControls.ImageButton.OnClick(ImageClickEventArgs e) +115
System.Web.UI.WebControls.ImageButton.RaisePostBackEvent(String eventArgument) +120
System.Web.UI.WebControls.ImageButton.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) +36
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5563
OK, same as before (logoff, update, restart, login) and I get this:
Invalid JSON primitive: False.
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.
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.
That means that you do have some Prevalues in your database. Could you look again and see if there are any rows with the datatype id of your newly created datatype?
OK, there was a record in the DB, Itried deleting it and editing the datatype again but it still failed. So, I created a new Data Type, selected "DataType Grid" and clicked Save. I then got the following error:
[ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index]
System.ThrowHelper.ThrowArgumentOutOfRangeException() +72
System.Collections.Generic.List`1.get_Item(Int32 index) +9585848
uComponents.Core.DataTypes.DataTypeGrid.DtgPrevalueEditor.ParsePrevalue(StoredConfig t) in C:\Users\ovea\Documents\Visual Studio 2010\Projects\uComponents\umbdatatypes\branches\v2.0\uComponents.Core\DataTypes\DataTypeGrid\DTG_PrevalueEditor.cs:829
uComponents.Core.DataTypes.DataTypeGrid.DtgPrevalueEditor.Save() in C:\Users\ovea\Documents\Visual Studio 2010\Projects\uComponents\umbdatatypes\branches\v2.0\uComponents.Core\DataTypes\DataTypeGrid\DTG_PrevalueEditor.cs:146
umbraco.cms.presentation.developer.editDatatype.save_click(Object sender, ImageClickEventArgs e) +31
System.Web.UI.WebControls.ImageButton.OnClick(ImageClickEventArgs e) +115
System.Web.UI.WebControls.ImageButton.RaisePostBackEvent(String eventArgument) +120
System.Web.UI.WebControls.ImageButton.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) +36
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5563
I have been running uComponents in debug mode and have finally figured out the issue.
There were some datatypes in my solution that had been left over from when I deleted another datatype package and these were causing the uComponents GetDataTypeGuid method to generate the error.
As soon as I removed the offending datatypes everything started to work, it might be worth trying to replicate this issue and putting in some error trapping to let someone know that this might be their issue as I can imagine this happening to others in the future.
Thanks all for your help and to Lee who just spent 30 minutes on Skype with me trying to debug the issue, you rock :)
Glad that you've got it resolved. I'm adding error logging to the code that handles the data-type look-ups, so should be easier to identify for other users, (well those who know to look in the error logs).
DataType Grid in v2.2 Beta gives error
I have installed v2.2 Beta on a fairly clean Umbraco v4.7 install, but whenever I try to create a Data Type using the new "DataType Grid", I get the following error:
Any ideas?
Can you post the db contents of your datatype (if any)? Look in the cmsDataTypePreValues table.
I can't see it in that table? Would it actually be in there if I am unable to create the DataType?
Nope. But it tells me that it fails early... :-)
I am not able to recreate the issue here, but will see if I can implement some more null-checking in the save code.
Could you try to to download the following dll and see if it works better?
http://www.eyecatch.no/media/19566/ucomponents_debug.zip
I downloaded the zip file and extracted the contents to the Bin folder. I restarted the App Pool in IIS and logged on, when I tried to create the DataTaype I got this
Hi Gordon,
Which type of database are you using? SQL Server (Express), SQL CE4 or MySQL?
I've been unable to replicate this error with Umbraco 4.7 with SQL CE4 ... but I have come across it before the v2.2 beta release.
Cheers, Lee.
Am using SQL Server 2008 Express - and it is the v2.2 Beta release. I had v2.1 installed which I uninstalled first.
I have now updated the file with some more null-checks.
Download the zip and see what happens now.
OK, same as before (logoff, update, restart, login) and I get this:
Invalid JSON primitive: False.
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: System.ArgumentException: Invalid JSON primitive: False.
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:
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1
That means that you do have some Prevalues in your database. Could you look again and see if there are any rows with the datatype id of your newly created datatype?
Arrgh, where di my reply go??
OK, there was a record in the DB, Itried deleting it and editing the datatype again but it still failed. So, I created a new Data Type, selected "DataType Grid" and clicked Save. I then got the following error:
I have just tried this on a seperate install and I get the same error message as Gordon does above.
( I am running on Windows 7 64 bit / SQL Express 2008 / IIS 7 / Full trust / Integrated Mode )
Cheers, Chris
Hi All,
I have been running uComponents in debug mode and have finally figured out the issue.
There were some datatypes in my solution that had been left over from when I deleted another datatype package and these were causing the uComponents GetDataTypeGuid method to generate the error.
As soon as I removed the offending datatypes everything started to work, it might be worth trying to replicate this issue and putting in some error trapping to let someone know that this might be their issue as I can imagine this happening to others in the future.
Thanks all for your help and to Lee who just spent 30 minutes on Skype with me trying to debug the issue, you rock :)
Best regards,
Chris
Hi Chris,
Glad that you've got it resolved. I'm adding error logging to the code that handles the data-type look-ups, so should be easier to identify for other users, (well those who know to look in the error logs).
Cheers, Lee.
I will also add some more checks so it will not fail hard if it the stored prevalue settings for the datatype is wrong.
is working on a reply...