Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Gordon Saxby 1461 posts 1883 karma points
    Jun 28, 2011 @ 18:33
    Gordon Saxby
    0

    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:

     

    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

    Any ideas?

  • Ove Andersen 435 posts 1541 karma points c-trib
    Jun 29, 2011 @ 08:59
    Ove Andersen
    0

    Can you post the db contents of your datatype (if any)? Look in the cmsDataTypePreValues table.

  • Gordon Saxby 1461 posts 1883 karma points
    Jun 29, 2011 @ 09:04
    Gordon Saxby
    0

    I can't see it in that table? Would it actually be in there if I am unable to create the DataType?

     

  • Ove Andersen 435 posts 1541 karma points c-trib
    Jun 29, 2011 @ 09:25
    Ove Andersen
    0

    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.

  • Ove Andersen 435 posts 1541 karma points c-trib
    Jun 29, 2011 @ 09:43
    Ove Andersen
    0

    Could you try to to download the following dll and see if it works better?

    http://www.eyecatch.no/media/19566/ucomponents_debug.zip

     

  • Gordon Saxby 1461 posts 1883 karma points
    Jun 29, 2011 @ 10:15
    Gordon Saxby
    0

    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

     

     

     

     

  • Lee Kelleher 4026 posts 15836 karma points MVP 13x admin c-trib
    Jun 29, 2011 @ 12:33
    Lee Kelleher
    0

    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.

  • Gordon Saxby 1461 posts 1883 karma points
    Jun 29, 2011 @ 12:51
    Gordon Saxby
    0

    Am using SQL Server 2008 Express - and it is the v2.2 Beta release. I had v2.1 installed which I uninstalled first.

     

  • Ove Andersen 435 posts 1541 karma points c-trib
    Jun 29, 2011 @ 13:02
    Ove Andersen
    0

    I have now updated the file with some more null-checks.

    Download the zip and see what happens now.

  • Gordon Saxby 1461 posts 1883 karma points
    Jun 29, 2011 @ 13:17
    Gordon Saxby
    0

    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:

    [ArgumentException: Invalid JSON primitive: False.]
       System.Web.Script.Serialization.JavaScriptObjectDeserializer.DeserializePrimitiveObject() +569604
       System.Web.Script.Serialization.JavaScriptObjectDeserializer.DeserializeInternal(Int32 depth) +263
       System.Web.Script.Serialization.JavaScriptObjectDeserializer.BasicDeserialize(String input, Int32 depthLimit, JavaScriptSerializer serializer) +80
       System.Web.Script.Serialization.JavaScriptSerializer.Deserialize(JavaScriptSerializer serializer, String input, Type type, Int32 depthLimit) +44
       System.Web.Script.Serialization.JavaScriptSerializer.Deserialize(String input) +74
       uComponents.Core.DataTypes.DataTypeGrid.DtgHelpers.GetSettings(Int32 dataTypeDefinitionId) in C:\Users\ovea\Documents\Visual Studio 2010\Projects\uComponents\umbdatatypes\branches\v2.0\uComponents.Core\DataTypes\DataTypeGrid\DTG_Helpers.cs:178
       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:126
       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  

     

     

  • Ove Andersen 435 posts 1541 karma points c-trib
    Jun 29, 2011 @ 13:32
    Ove Andersen
    0

    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?

  • Gordon Saxby 1461 posts 1883 karma points
    Jun 29, 2011 @ 14:21
    Gordon Saxby
    0

    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:

    [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
     

     

  • Chris Houston 535 posts 980 karma points MVP admin c-trib
    Jun 29, 2011 @ 16:48
    Chris Houston
    0

    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

  • Chris Houston 535 posts 980 karma points MVP admin c-trib
    Jun 29, 2011 @ 18:23
    Chris Houston
    0

    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

  • Lee Kelleher 4026 posts 15836 karma points MVP 13x admin c-trib
    Jun 29, 2011 @ 22:03
    Lee Kelleher
    0

    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.

  • Ove Andersen 435 posts 1541 karma points c-trib
    Jun 30, 2011 @ 10:47
    Ove Andersen
    0

    I will also add some more checks so it will not fail hard if it the stored prevalue settings for the datatype is wrong.

Please Sign in or register to post replies

Write your reply to:

Draft