Copied to clipboard

Flag this post as spam?

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


  • Rich Lee 26 posts 116 karma points
    Sep 03, 2013 @ 16:51
    Rich Lee
    0

    6.1.3 -> 6.1.5 breaks Media Type settings

    I have an MVC4 project based on 6.1.3. I have a custom media type which I make available to a DAMP image picker by setting it as an allowed child nodetype on the Structure tab of the Folder Media Type. I do this in code with a few lines pinched from DAMP itself:

                var folder = umbraco.cms.businesslogic.media.MediaType.GetByAlias("Folder");

                var folderStructure = folder.AllowedChildContentTypeIDs;

                var newsize = folderStructure.Count() + 1;

                Array.Resize(ref folderStructure, newsize);

                folderStructure[newsize - 1] = myNewMediaType.Id;

                folder.AllowedChildContentTypeIDs = folderStructure;

                folder.Save();

    Yes, the media.MediaType call is v4 and marked as obsolete, but a) there's no v6 equivalent and b) I discussed with Jeroen and we didn't think it would disappear before v8. So this works nicely against 6.1.3 and I can see the Folder child nodetype is checked in the back office.
    When I upgrade to 6.1.5 by setting umbracoConfigurationStatus to "" and spinning up against the existing database then the Folder child nodetype is no longer checked.
    It looks to me like the DAMP fixups for 6.1.5 have had the side-effect of breaking some of the v4 APIs.
    Can somebody either tell me the v6 equivalent (although a few weeks ago Jeroen pointed me at v4 Apis) or ack this as a defect and fast-track a fix please?
    Rich

     

  • Sebastiaan Janssen 5045 posts 15476 karma points MVP admin hq
    Sep 04, 2013 @ 10:53
    Sebastiaan Janssen
    0

    What exactly do you mean by: "Folder child nodetype is no longer checked."

    Checked in code? If so what code? What line of code is breaking for you, or where in the code that you posted do you get a different result than before?

    Or are you missing a checkbox that was checked ON before and is OFF now? If so, where?

  • Rich Lee 26 posts 116 karma points
    Sep 04, 2013 @ 12:08
    Rich Lee
    0

    Hi Sebastiaan,

    We're writing C#/MVC to set up a custom media type which uses DAMP for user-selection and an image cropper to pre-set some crops. So that the custom media type is available in the DAMP picker it needs to be checked as an allowed child node in the Structure tab of the Folder node under Media Types. With 6.1.3 I can do this using the code above, but on upgrade to 6.1.5 it gets unchecked. So the checkbox for my custom Media Type is still there, but it isn't checked.

     

    BTW I can't do a clean 6.1.5 install as I get an 'UmbracoUser' error which I've posted about in the Getting Started/Installing Umbraco subforum. So I can't say whether this is an upgrade step defect only or is present in the upgraded codebase.

     

    Rich

  • Sebastiaan Janssen 5045 posts 15476 karma points MVP admin hq
    Sep 04, 2013 @ 20:03
    Sebastiaan Janssen
    0

    What's the link to the UmbracoUser error please?

    We haven't made any changes to the MediaType class in 4 months so I'm puzzled as to why this wouldn't work any more.

  • Rich Lee 26 posts 116 karma points
    Sep 05, 2013 @ 11:17
    Rich Lee
    0

    The 6.1.5. clean-install issues is at http://our.umbraco.org/forum/getting-started/installing-umbraco/44511-615-Invalid-object-name-umbracoUser.

    DIdn't 6.1.5 make some fixes to do wiith DAMP usage? Maybe the install script doesn't play nice with the child nodes array on the Folder node - it is a slightly obscure setting.

    Rich

  • Sebastiaan Janssen 5045 posts 15476 karma points MVP admin hq
    Sep 05, 2013 @ 16:46
    Sebastiaan Janssen
    0

    The "fix" we put in 6.1.5 is to make it behave like it did in 6.1.3 and is not specific to DAMP but all datatypes in general (the discovery of the bug was just first through DAMP but later narrowed down to the image cropper). So that should have nothing to do with the problem you're seeing.

    I just ran your code on 6.1.5 and this is the result (see screenshot), I did not manually click anything. This is what you intend to do, correct?

    enter image description here

  • Rich Lee 26 posts 116 karma points
    Sep 06, 2013 @ 11:17
    Rich Lee
    0

    Thanks for replying in detail Sebastiaan.

    Yes, that is exactly what I'm trying to do. I'll see if I can find some slack time later to try again.

    Rich

Please Sign in or register to post replies

Write your reply to:

Draft