Copied to clipboard

Flag this post as spam?

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


  • Gibran Shah 69 posts 240 karma points
    Oct 19, 2020 @ 03:31
    Gibran Shah
    0

    Changing doc type of my content item duplicated content item

    Hello,

    Something strange happened when I changed the doc type on one of my content pages. All of a sudden, my website started listing the page twice.

    If you go here:

    http://hollandandbarnes.azurewebsites.net/dining/

    ...you see a list of links on the right. One of them is "Irish Pubs". <-- This was the one that was repeating twice--just because I changed the doc type of the Irish Pubs content item. I tried deleting it in Umbraco so now it looks like this in the Umbraco content tree:

    enter image description here

    ...but "Irish Pubs" is still showing up once on the page (as you see now):

    enter image description here

    I can still open the content form by typing its id in the url:

    http://localhost:64245/umbraco#/content/content/edit/1462

    But it won't let me save any changes. It just lets me restore in which case it brings the content item back and I get two "Irish Pubs" again:

    enter image description here

    How is it that it got duplicated and how can I fix this? Thanks.

  • Marc Goodson 2157 posts 14431 karma points MVP 9x c-trib
    Oct 20, 2020 @ 07:33
    Marc Goodson
    1

    Hi Gibran

    Umbraco serves content from a published cache (in v7 this an xml file called umbraco. config stored in memory (and on disk)

    When you make a change to an item in umbraco it is saved to the database... When you publish, the page entry is found in the umbraco cache and its details updated. When you unpublish a page it's entry is removed from the published cache file.

    What appears to have happened here is the change in doc type has meant that publishing process has somehow seen this as a new document and added an entry instead of updating the existing entry... And the existing entry remains in the cache file unaware of the change and 'orphaned' - no longer able to be updated.

    You can probably avoid this by unpublishing a page before changing its doc type... But that's not intuitive! Feels like a quirk/bug that this can occur

    Anyway if you rebuild your xml cache file the duplicate will disappear

    If you visit

    /umbraco/dialogs/republish.aspx?xml=true

    And press the button to republish

    It should fix the duplicate issue.

    Regards

    Marc

Please Sign in or register to post replies

Write your reply to:

Draft