Copied to clipboard

Flag this post as spam?

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


  • Alexadar 17 posts 37 karma points
    Nov 21, 2011 @ 20:15
    Alexadar
    0

    Cant add property

    Recently i tried to add viewCounter to my document type. I got next error:

    Server Error in '/' Application.




    Value cannot be null.

    Parameter name: Property viewCount (81) on Content Type umbHomepage could not be retrieved for Document 1083 on Tab Page Site. To fix this problem, delete the property and recreate it.

    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.ArgumentNullException: Value cannot be null.

    Parameter name: Property viewCount (81) on Content Type umbHomepage could not be retrieved for Document 1083 on Tab Page Site. To fix this problem, delete the property and recreate it.


    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: 


    [ArgumentNullException: Value cannot be null.

    Parameter name: Property viewCount (81) on Content Type umbHomepage could not be retrieved for Document 1083 on Tab Page Site. To fix this problem, delete the property and recreate it.]

       umbraco.controls.ContentControl.CreateChildControls() +1199

       System.Web.UI.Control.EnsureChildControls() +182

       umbraco.controls.ContentControl.OnInit(EventArgs e) +123

       System.Web.UI.Control.InitRecursive(Control namingContainer) +133

       System.Web.UI.Control.AddedControl(Control control, Int32 index) +277

       umbraco.cms.presentation.editContent.OnInit(EventArgs e) +1005

       System.Web.UI.Control.InitRecursive(Control namingContainer) +133

       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1970







    Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.237

    How i can fix it?

    What is simpliest way to add counter to the master template, and update it each visiting time?

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Nov 21, 2011 @ 22:21
    Jan Skovgaard
    0

    Hi Alexadar

    What version of Umbraco are you using it on?

    /Jan

  • Alexadar 17 posts 37 karma points
    Nov 22, 2011 @ 01:14
    Alexadar
    0

    Hi Jan

    Im using version umbraco v 4.7.1 (Assembly version: 1.0.4281.20201)

  • Robert Foster 459 posts 1820 karma points MVP 2x admin c-trib
    Nov 22, 2011 @ 05:13
    Robert Foster
    0

    Hi Alexadar,

    Can you tell me how you set up the ViewCounter Datatype?  Did you customise it or just use the one out of the box?  How did you add the counter to the page?

    The simplest way to add a counter to the master template is to use a macro;  There's a sample Page Views macro included in the package that you can modify and include on the master template; 

    Be aware though that the Razor Script for the macro currently contains an error.  I renamed one of the functions in the library from HideCounter to CounterHidden which broke the macro.  Sorry about that.  The new macro should look like this - I'll upload a revised package shortly:

    @inherits umbraco.MacroEngines.DynamicNodeContext
    @using umbraco.MacroEngines;
    @using umbraco.NodeFactory;
    @using Refactored.UmbracoViewCounter;

    @if (!ViewCount.CounterHidden(Model.Id, category: Parameter.Category)) {
      <span># Views:@ViewCount.GetViewCount(@Model.Id, @Parameter.Category, @Parameter.Increment == "1").ToString("N0")
    } else {
      ViewCount.Increment(Model.Id, category: Parameter.Category);
    }
  • Alexadar 17 posts 37 karma points
    Nov 22, 2011 @ 12:15
    Alexadar
    0

    For the test I just added a View Counter (unmodified) to my masterpage as property and got this error.

     

  • Robert Foster 459 posts 1820 karma points MVP 2x admin c-trib
    Nov 22, 2011 @ 12:23
    Robert Foster
    0

    have you tried removing it and adding it again like the error message suggests?  I did the same thing without any errors.

     

  • Alexadar 17 posts 37 karma points
    Nov 22, 2011 @ 12:25
    Alexadar
    0

    You included the next XSLT in a package:

     <?xml version="1.0" encoding="UTF-8"?>

    <!DOCTYPE xsl:stylesheet [

      <!ENTITY nbsp "&#x00A0;">

    ]>

    <xsl:stylesheet

      version="1.0"

      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"

      xmlns:msxml="urn:schemas-microsoft-com:xslt"

      xmlns:umbraco.library="urn:umbraco.library"

      xmlns:Exslt.ExsltCommon="urn:Exslt.ExsltCommon"

      xmlns:ViewCount="urn:ViewCount"

      exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon ViewCount ">

     

     

      <xsl:output method="xml" omit-xml-declaration="yes"/>

     

      <xsl:param name="currentPage"/>

     

      <xsl:template match="/">

        <ul>

          <xsl:for-each select="$currentPage//* [@isDoc ]">

            <xsl:sort select="ViewCount:GetViews(number(@id))//@count" order="descending"/>

            <xsl:variable name="counter" select="ViewCount:GetViews(number(@id))" />

            <li>

              Node: <xsl:value-of select="$counter//@nodeId" /><br />

              Count: <xsl:value-of select="$counter//@count" /><br />

              Last Viewed: <xsl:value-of select="$counter//@lastViewed" /><br />

              Category: <xsl:value-of select="$counter//@category" /><br />

              hide Counter: <xsl:value-of select="$counter//@hideCounter" /><br />

              enable History: <xsl:value-of select="$counter//@enableHistory" />

            </li>

          </xsl:for-each>

        </ul>

      </xsl:template>

     

    </xsl:stylesheet>

    I cant see where your macro can modify counter for current page. Your macro only getting a data from sub-pages.

     

  • Robert Foster 459 posts 1820 karma points MVP 2x admin c-trib
    Nov 22, 2011 @ 12:27
    Robert Foster
    0

    That's a separate issue - please start a new thread... Have you resolved the issue with the error you reported at the start of this thread?

  • Alexadar 17 posts 37 karma points
    Nov 22, 2011 @ 12:31
    Alexadar
    0

    No.

    I uninstalled all previous versions of your package, thaen i installed 0.5.

    I added a View Counter property to my Document Type, named it viewCounter and i got same error.

  • Alexadar 17 posts 37 karma points
    Nov 22, 2011 @ 12:33
    Alexadar
    0

    Okay, another update:

    When i tired to delete this property, i got error

    Server Error in '/' Application.

     

    The DELETE statement conflicted with the REFERENCE constraint "FK_cmsPropertyData_cmsPropertyType". The conflict occurred in database "led-lum", table "dbo.cmsPropertyData", column 'propertytypeid'.

    The statement has been terminated.

     

    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.Data.SqlClient.SqlException: The DELETE statement conflicted with the REFERENCE constraint "FK_cmsPropertyData_cmsPropertyType". The conflict occurred in database "led-lum", table "dbo.cmsPropertyData", column 'propertytypeid'.

    The statement has been terminated.

     

    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: 

     

     

    [SqlException (0x80131904): The DELETE statement conflicted with the REFERENCE constraint "FK_cmsPropertyData_cmsPropertyType". The conflict occurred in database "led-lum", table "dbo.cmsPropertyData", column 'propertytypeid'.

    The statement has been terminated.]

       System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +404

       System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning() +412

       System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +1363

       System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async) +2899484

       System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) +504

       System.Data.SqlClient.SqlCommand.ExecuteNonQuery() +327

       Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteNonQuery(String connectionString, CommandType commandType, String commandText, SqlParameter[] commandParameters) +167

       umbraco.DataLayer.SqlHelper`1.ExecuteNonQuery(String commandText, IParameter[] parameters) +150

     

    [SqlHelperException: Umbraco Exception (DataLayer): SQL helper exception in ExecuteNonQuery]

       umbraco.DataLayer.SqlHelper`1.ExecuteNonQuery(String commandText, IParameter[] parameters) +261

       umbraco.cms.businesslogic.propertytype.PropertyType.delete() +199

       umbraco.controls.ContentTypeControlNew.gpw_Delete(Object sender, EventArgs e) +53

       System.EventHandler.Invoke(Object sender, EventArgs e) +0

       System.Web.UI.WebControls.ImageButton.OnClick(ImageClickEventArgs e) +187

       System.Web.UI.WebControls.ImageButton.RaisePostBackEvent(String eventArgument) +165

       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

     

     

    I resolved this error by changing a type of property, before i delete it.

  • Robert Foster 459 posts 1820 karma points MVP 2x admin c-trib
    Nov 22, 2011 @ 12:33
    Robert Foster
    0

    Do you see the error when you try to edit a Content Node, view a content node, or edit a document type?  What exactly are you doing when you get the error? Can you take a screen dump of it and include it in a reply?

  • Alexadar 17 posts 37 karma points
    Nov 22, 2011 @ 12:44
    Alexadar
    0

    Sure:

  • Robert Foster 459 posts 1820 karma points MVP 2x admin c-trib
    Nov 22, 2011 @ 12:56
    Robert Foster
    0

    huh.  so does this mean you resolved the issue?

    - I really should refresh the browser before posting a new comment...

  • Robert Hughes 87 posts 110 karma points
    May 30, 2012 @ 03:52
    Robert Hughes
    0

    Does anyone have a fix for this - i got the same thing and basically my entire DB was corrupted. I deleted the offending constraints and managed to remove my node from my document type but then my content node just complained about the next property.

    It is as if my entire database just got completely corrupted.

    Using 4.7.2

     

  • Dan 1285 posts 3917 karma points c-trib
    Jun 28, 2012 @ 18:45
    Dan
    0

    I have the same thing currently.  In my case what I think it could be is that I have thousands of content nodes with a lot of properties on the documents types.  The property which it's saying can't be retrieved is one that I added to the document type later, after populating and publishing the content.  I think because of the size of either the content nodes or the document type properties something has timed out behind the scenes when adding the new property, hence it hasn't added the database records correctly (or fully) and is now throwing exceptions.  This is potentially a huge problem and very difficult to fix :(

  • Robert Foster 459 posts 1820 karma points MVP 2x admin c-trib
    Jun 29, 2012 @ 01:40
    Robert Foster
    0

    I'll try to find time to look deeper into this today; however it may be a matter of submitting an issue on the issue tracker I think...

  • Robert Foster 459 posts 1820 karma points MVP 2x admin c-trib
    Jul 26, 2012 @ 03:18
    Robert Foster
    0

    I've had a chance today to look into the issue a little, but what I've seen suggests the problem relates to adding properties to Content Types that have existing nodes, and more specifically (Master) Content Types that have child Content Types.  While this seems to be working in version 4.8 at least, I'm not sure when/if the problems you're seeing have been fixed.  If you could post the version of Umbraco that you're seeing this in and how you have your Document Types set up, that would help...

  • Robert Hughes 87 posts 110 karma points
    Aug 27, 2012 @ 00:08
    Robert Hughes
    0

    I just got this problem again. Using Umbraco 4.7.2. This is my workflow for the rror.

    1. Had some existing nodes with existing Textstring property set. This property is on a top-level 'Page' document types. Most of my content has a document type which inhertis from this 'Page' document type.

    2. Added a new custom data type (enhanced Textstring essentially)

    3. Went to doctype and changed the datatype of my property from Textstring to Enhanced Textstring

    4. Try to re-open content in back-office I get error telling me to delete property and re-add it (this is terrible but at least it gives me a way out!)

    5. Try to delete the property- get an exception. 

    At /umbraco/settings/editNodeTypeNew.aspx?id=1053 (

    umbraco.DataLayer.SqlHelperException: Umbraco Exception (DataLayer): 

    SQL helper exception in ExecuteNonQuery ---> 

    System.Data.SqlClient.SqlException: The DELETE statement conflicted with the REFERENCE constraint "FK_cmsPropertyData_cmsPropertyType". 

    The conflict occurred in database "SkyCityIntranetUmbraco", table "dbo.cmsPropertyData", column 'propertytypeid'.  

    The statement has been terminated.     at 

    System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)     at 

    System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()     at 

    System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)     at 

    System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async)     at 

    System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)     at 

    System.Data.SqlClient.SqlCommand.ExecuteNonQuery()     at Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteNonQuery(String connectionString, CommandType commandType, String commandText, SqlParameter[] commandParameters)     at 

    umbraco.DataLayer.SqlHelpers.SqlServer.SqlServerHelper.ExecuteNonQuery(String commandText, SqlParameter[] parameters) in C:\Source\Umbraco\Umbraco 472\umbraco\datalayer\SqlHelpers\SqlServer\SqlServerHelper.cs:line 75     at 

    umbraco.DataLayer.SqlHelper`1.ExecuteNonQuery(String commandText, IParameter[] parameters) in C:\Source\Umbraco\Umbraco 472\umbraco\datalayer\SqlHelper.cs:line 220     --- End of inner exception stack trace ---     at

    umbraco.DataLayer.SqlHelper`1.ExecuteNonQuery(String commandText, IParameter[] parameters) in C:\Source\Umbraco\Umbraco 472\umbraco\datalayer\SqlHelper.cs:line 226     at 

    umbraco.cms.businesslogic.propertytype.PropertyType.delete() in C:\Source\Umbraco\Umbraco 472\umbraco\cms\businesslogic\propertytype\propertytype.cs:line 348     at 

    umbraco.controls.ContentTypeControlNew.gpw_Delete(Object sender, EventArgs e) in C:\Source\Umbraco\Umbraco 472\umbraco\presentation\umbraco\controls\ContentTypeControlNew.ascx.cs:line 524     at 

    umbraco.controls.GenericProperties.GenericPropertyWrapper.GenericPropertyWrapper_Delete(Object sender, EventArgs e) in C:\Source\Umbraco\Umbraco 472\umbraco\presentation\umbraco\controls\GenericProperties\GenericPropertyWrapper.cs:line 86     at 

    System.EventHandler.Invoke(Object sender, EventArgs e)     at 

    umbraco.controls.GenericProperties.GenericProperty.DeleteButton2_Click(Object sender, ImageClickEventArgs e) in C:\Source\Umbraco\Umbraco 472\umbraco\presentation\umbraco\controls\GenericProperties\GenericProperty.ascx.cs:line 249     at 

    System.Web.UI.WebControls.ImageButton.OnClick(ImageClickEventArgs e)     

    System.Web.UI.WebControls.ImageButton.RaisePostBackEvent(String eventArgument)     

    at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

  • Robert Foster 459 posts 1820 karma points MVP 2x admin c-trib
    Aug 28, 2012 @ 08:17
    Robert Foster
    0

    You might want to lodge this as a bug in the Umbraco Issue Tracker - it's not really relevant to the View Counter that this forum is supposed to be about :)

    Go to http://our.umbraco.org/contribute/report-an-issue-or-request-a-feature for more details on how to do that...

    Rob.

Please Sign in or register to post replies

Write your reply to:

Draft