Copied to clipboard

Flag this post as spam?

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


  • Steven 33 posts 166 karma points
    May 10, 2013 @ 20:58
    Steven
    0

    Issues on content after changing media type alias

    Hi Folks,

    I am encountering an issue with displaying some of my existing content using a razor macro ... I am getting the following error:

    No node exists with id '0'    at umbraco.cms.businesslogic.CMSNode.setupNode()
      at umbraco.cms.businesslogic.ContentType.setupNode()
      at umbraco.cms.businesslogic.CMSNode..ctor(Int32 Id)
      at umbraco.cms.businesslogic.ContentType.GetByAlias(String Alias)
      at umbraco.cms.businesslogic.ContentType.<>c__DisplayClassb.<GetDataType>b__a(Tuple`2 tuple)
      at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
      at umbraco.cms.businesslogic.ContentType.GetDataType(String contentTypeAlias, String propertyTypeAlias)
      at umbraco.MacroEngines.DynamicNode.<.cctor>b__10d(String docTypeAlias, String propertyAlias)
      at umbraco.MacroEngines.DynamicNode.GetDataType(String docTypeAlias, String propertyAlias)
      at umbraco.MacroEngines.DynamicNode.TryGetPropertyData(PropertyResult propResult, Object& result)
      at umbraco.MacroEngines.DynamicNode.TryGetMember(GetMemberBinder binder, Object& result)
      at CallSite.Target(Closure , CallSite , Object

    This seems to happen where I am referring to a media using the syntax:

    @item.Media("sampleThumb").thumbnail

    ( If I leave that line out then everything works fine )

    What did I do ?

    I upgraded my system from 6.0.3 towards version 6.0.5 ... I think however this is not the impact. I tested my site locally right after the upgrade and it seemed working fine ... The scripts use caching however so I am not completely sure ...

    Next I did maybe something stupid ... I started working on new content where I wanted to use the media type as well and I realised that my custom media type alias was named to content specific so I changed the alias and the description ... assuming it was only an alias so it would not impact my current data ...

    But unfortunately it does ...  after the rename the existing document content using that media type do no longer work ...  When I create a new document using the same document type then that one works fine ! My new content also works fine with the media type.

    I checked some of the tables but at first sight I do not see an issue ... the content type table is still holding the same referenced nodeId - only its alias is changed ...

    When I compare my local site table data ( where I did this change ) with my productive site then I notice however that the table 'cmsContentXML' is missing all the entries locally which reference that renamed media type  ... 

    The media section itself still displays all the images correctly and shows the new alias name correctly

    Thanks for any insights,

    Steven


  • Steven 33 posts 166 karma points
    May 11, 2013 @ 09:05
    Steven
    100

    Hey Folks,

    After a good night of sleep and a fresh morning with a cup of coffee I managed to solve the issue ...

    The issue in my opinion - I am not an Umbraco expert - was the fact that my media entries were no longer available anymore in table 'cmsContentXML' ... by changing the media type alias somehow my existing media entries of that type were removed from the table ... but they were not readded ...

    I tried to use the url 'umbraco/dialogs/refresh.aspx?xml=true'  to get a complete cache refresh but I guess that merely builds the complete XMLdocument  based upon the above table ...

    So I ended up resaving all my media types manually and after that the table was back filled and my site worked again ... 

    Might be an idea for a future enhancement - either do not allow to change a media type alias if there is already existing content referring to it or - much better - ensure that the affected media types are resaved after the change ...

    Created an issue for this ...  http://issues.umbraco.org/issue/U4-2216 

    And oh ... all this misery started because I was too lazy to create a new media type by hand because there is no copy option on media types while there is one for document types ... might be interesting to add that as well :P

    Thanks,

    Steven

Please Sign in or register to post replies

Write your reply to:

Draft