Copied to clipboard

Flag this post as spam?

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


  • Felix 46 posts 67 karma points
    Jun 30, 2010 @ 09:10
    Felix
    0

    changing master document type

    hi all,

    so im trying to change the existing document type of an existing doc type.

    My structure is as follows:

    Main Page (main doc type)

    Home Page and General Page are 2 document types that has "Main Page" set as the master doc type.

    I now want a layer in between called Middle Page , so i want Middle Page to extend from Main Page and Home Page and General Page to extend from Middle Page, i changed the cmsContentType table to achieve most of it. I successfully have Sub page inheriting from Main page, and Home page then inheriting from Sub Page. and i can modify my home page in the tree just fine. However all my General Page nodes in the site tree, gives me a "object reference not set to instance of an object" exception.

     

    Not quiet sure why only this document type is doing that and the other one worked just fine, any ideas?

     

    thanks in advance!

     

  • Matt Brailsford 4124 posts 22215 karma points MVP 9x c-trib
    Jun 30, 2010 @ 09:25
    Matt Brailsford
    2

    Hey Felix,

    Depending on the version of Umbraco you are using (ie, I'm currently working on 4.5 support) you could have used my Master Doc Type Switcher package to do the job for you

    http://our.umbraco.org/projects/master-doc-type-switcher

    Looking through my code though, I also make changes to the cmsPropertyData table to map over any properties to the new property types of the master page, so maybe you could start there?

    Matt

  • Felix 46 posts 67 karma points
    Jul 01, 2010 @ 02:28
    Felix
    0

    Hi Matt,

     

    Thanks for your reply.

    I did actually try your package, however once i run it, all nodes of type General Page dissapear from the tree. What still puzzles me is why Home works just fine and only General Page is broken.

    im running umbraco v 4.0.4.1

     

  • Matt Brailsford 4124 posts 22215 karma points MVP 9x c-trib
    Jul 01, 2010 @ 13:15
    Matt Brailsford
    0

    It's a bit difficuilt to suggest anything else at the moment as the "object reference not set to instance of an object" exception is quite vague without context. Is there any other stack trace that might suggest where the exception is being thrown from?

    Matt

  • Anders Burla 2560 posts 8256 karma points
    Jul 01, 2010 @ 13:28
    Anders Burla
    0

    Matt is a great package you have created and a thing i often misses in Umbraco to change the doc structure when the client comes up with a new feature they want and you have to change your structure to make it the best as possible. Is it hardcore programming to change the doc type or is it because some of the Umbraco data is corrupted?

  • Matt Brailsford 4124 posts 22215 karma points MVP 9x c-trib
    Jul 01, 2010 @ 13:37
    Matt Brailsford
    0

    Hi Anders,

    It's not that difficuilt, it's just making sure you tie up all loose ends by mapping over, or deleting any properties you no longer need. I've got plans to extend my project to allow for the extraction of a master doc type from an existing doc type (kinda like refactoring your doc types), but it's just finding the time at the moment.

    Matt

  • Anders Burla 2560 posts 8256 karma points
    Jul 01, 2010 @ 14:02
    Anders Burla
    0

    Refactoring of doc types sounds just like the thing we need :)

  • snake001 4 posts 25 karma points
    Jul 15, 2010 @ 22:35
    snake001
    0

    Hi All,

    I have the same problem with disappearing content.

    I had sth like:

    => Categories

    => Articles

    I changed it into:

    | => Categories

    | ====>  Articles

    (so now articles inherit from categories)

     

    And the content disappeared in Content section, though it's still accessible through front-end.

    I tried to verify the database, but everything seems just fine.

    I added new Article to Category, and it's displayed correctly, though the old articles didn't come up.

    Tried to refresh the cache as well.

     

    I'm not sure how to proceed with testing, if you have any idea about how I can provide more info to get help please let me know.

    I use version 4.0.4.2

     

    Thanks!

    Mateusz

     

Please Sign in or register to post replies

Write your reply to:

Draft