Copied to clipboard

Flag this post as spam?

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


  • Martin 44 posts 66 karma points
    Feb 18, 2013 @ 15:52
    Martin
    0

    Problems after upgrading to Umbraco 6

    Hi there,

    I've upgraded a Umbraco 4 solution to Umbraco 6. The ugrade went well and the site is running again. However Umbraco writes ALOT of data to the cmsPreviewXml and cmsPropertyData tables.

    This didnt happen before the upgrade. What's causing this problem?

    When I click on a node in Umbraco, the cmsPreviewXml table row count increases by 40.

    Here's a screenshot of the cmsPreviewXml table: http://imgur.com/w83G1EQ

     

  • Martin 44 posts 66 karma points
    Feb 19, 2013 @ 17:36
    Martin
    0

    After some debugging I've found the code which causes this problem. However I'm not sure why.

     

    Umbraco runs this code:

    1) umbraco.cms.presentation.editContent:

    _document = new Document(true, id);

    2) umbraco.cms.businesslogic.web.Document (here it seems that Content sometimes has the wrong version number)

    Content = ApplicationContext.Current.Services.ContentService.GetById(id);

    [...]

    InitializeContent(Content.ContentType.Id, Content.Version, Content.UpdateDate,

                                      Content.ContentType.Icon);

    InitializeDocument(creator, writer, Content.Name, templateId, tmpReleaseDate, tmpExpireDate,

                                       Content.UpdateDate, Content.Published);

    3) umbraco.cms.businesslogic.Content

    string sql = @"select id, propertyTypeId from cmsPropertyData where versionId=@versionId";

     

                using (IRecordsReader dr = SqlHelper.ExecuteReader(sql,

                    SqlHelper.CreateParameter("@versionId", Version)))

                {

                    while (dr.Read())

                    {

                        //add the item to our list

                        propData.Add(new { Id = dr.Get<int>("id"), PropertyTypeId = dr.Get<int>("propertyTypeId") });

                    }

                }

    When the fetched version number in step 2 is invalid, the propData collection is empty, and Umbraco starts creating the cmsPropertyData values in the database.

    I've tried searching in the Umbraco source, and the overloaded constructor for the Document class only seems to be used inside the editContent class, so I changed the code from:

    _document = new Document(true, id); (line 62)

    to:

    _document = new Document(id);

     

    That seems to fix the problem, but is that the right way to fix it? Am I the only one, who is having this problem?

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Feb 19, 2013 @ 19:41
    Jan Skovgaard
    1

    Hi Martin

    I think you should report this issue as a bug in the issue tracker here issues.umbraco.org/issues/U4 - This way the core team will get notified and can make a fix for this - make sure to check if someone else has already reported it.

    And thanks for sharing this.

    /Jan

  • Martin 44 posts 66 karma points
    Feb 19, 2013 @ 19:49
    Martin
    1

    Hi Jan,

    I've created the bug here: http://issues.umbraco.org/issue/U4-1742

    Thank you.

  • Thomas 49 posts 78 karma points c-trib
    Jun 18, 2013 @ 12:56
    Thomas
    0

    Did this ever get fixed? Can't see any updates in the Umbraco issue tracker after you submittet.

    Is the problem only with previwing pages..?

     

Please Sign in or register to post replies

Write your reply to:

Draft