Open Scherling opened 2 years ago
Hi,
I think this works but if you are editing the files you have to be careful of a number of things.
If you create a new doctype by file, it much have a unique key (GUID) if you just copy something that is already there and don't alter this, then you will get clashes.
When setting the parent / compostion make sure you update the key and alias values to match those of your baseItemPage This is how the parent is defined (and where things show in the tree). I suspect this is where it is going wrong for you
Ensure the levels of the files make sense (e.g baseItemPage has level 2, itemPage has level 3). the Level in the uSync file isn't actually part of the information synced into Umbraco it determains the order of the sync, so for example all level 1 items get synced before level 2 and then level 3.
for my test i have
basePage (created inside Umbraco)
<?xml version="1.0" encoding="utf-8"?>
<ContentType Key="66efd9d0-b997-45c5-9c66-037aa96fe53c" Alias="basePage" Level="1">
<Info>
<Name>BasePage</Name>
<Icon>icon-item-arrangement</Icon>
<Thumbnail>folder.png</Thumbnail>
<Description></Description>
<AllowAtRoot>False</AllowAtRoot>
<IsListView>False</IsListView>
<Variations>Nothing</Variations>
<IsElement>false</IsElement>
<Compositions />
<DefaultTemplate></DefaultTemplate>
<AllowedTemplates />
</Info>
<Structure />
<GenericProperties />
<Tabs />
</ContentType>
baseItemPage (created by hand - its a copy of the orginnal itemPage with the key changed (note i just change 39 to 40 at the end of the key))
<?xml version="1.0" encoding="utf-8"?>
<ContentType Key="3f3556e5-3ac2-4fda-b8f9-4b42934a4b40" Alias="baseItemPage" Level="2">
<Info>
<Name>BaseItemPage</Name>
<Icon>icon-item-arrangement</Icon>
<Thumbnail>folder.png</Thumbnail>
<Description></Description>
<AllowAtRoot>False</AllowAtRoot>
<IsListView>False</IsListView>
<Variations>Nothing</Variations>
<IsElement>false</IsElement>
<Parent Key="66efd9d0-b997-45c5-9c66-037aa96fe53c">basePage</Parent>
<Compositions>
<Composition Key="66efd9d0-b997-45c5-9c66-037aa96fe53c">basePage</Composition>
</Compositions>
<DefaultTemplate></DefaultTemplate>
<AllowedTemplates />
</Info>
<Structure />
<GenericProperties />
<Tabs />
</ContentType>
itemPage (create in Umbraco but then the Parent, Key and alias, and composition key and alias have changed to be those of the baseItemPage)
<?xml version="1.0" encoding="utf-8"?>
<ContentType Key="3f3556e5-3ac2-4fda-b8f9-4b42934a4b39" Alias="itemPage" Level="3">
<Info>
<Name>ItemPage</Name>
<Icon>icon-item-arrangement</Icon>
<Thumbnail>folder.png</Thumbnail>
<Description></Description>
<AllowAtRoot>False</AllowAtRoot>
<IsListView>False</IsListView>
<Variations>Nothing</Variations>
<IsElement>false</IsElement>
<Parent Key="3f3556e5-3ac2-4fda-b8f9-4b42934a4b40">baseItemPage</Parent>
<Compositions>
<Composition Key="3f3556e5-3ac2-4fda-b8f9-4b42934a4b40">baseItemPage</Composition>
</Compositions>
<DefaultTemplate></DefaultTemplate>
<AllowedTemplates />
</Info>
<Structure />
<GenericProperties />
<Tabs />
</ContentType>
after a sync it looks like this.
I did some additional testing, and I wrongly assumed this to be an issue with the document type you update. It's not, but rather, it's an issue with the document types even lower in the hierachy. I think I confused myself a bit when I tried making a more generic example for the bug report.
Continuing my above example, if the tree structure contain an additional level, let's call it SubItemPage
below ItemPage
so that the final structure after the import looks like this:
Then pages below the changed page, is not updated accordingly. For SubItemPage I've increased the Level value in the config:
The usync report before the import looks like this "xml is different - but properties may not have changed"
And level and path is not bumped up in the DB
And just to clarify, the above post is still me, I just accidentally used my work account to post :)
OK, i will need to check this, it might be an Umbraco thing (but will see if i can confirm) - uSync sets the parent item via the Umbraco API, we don't actually set path or level - because these should be (and are usually) calculated when you set the parent.
so i wonder if something is going wrong when that happens, will take a deeper dive and see if we can sort the issue.
Hi I still can't reproduce this locally 😞
My testing below:
I have a number of files created by Umbraco and from uSync files.
at this point everything appears to be in the right place.
BaseChildFile
config. to move its level:Change its level (to 4)
change its parent and compositon values
run the import:
UI is ok
DB looks ok
BaseFromFile
I am not sure what might be happening for you, but if the parent Key and Alias are set correctly, then Umbraco should be doing all the work to update the path and level values - as i said above the Level value for us isn't something we set in Umbraco its only really used to ensure things are imported in level order (e.g level 1 before level 5).
K
Hi, thanks for investigating.
I will have to figure out if it's something else causing this issue, then. I'll let you know if I figure it out.
@Scherling Same issue here, version 9.2.0 of uSync, umbraco.Cms 9.3.1
The solution that currently works in my case is using import option few times until my pages move to the correct structure. Keys are fine, whole configuration is fine.
But it is annoying to use import few times until everything sorts out. Not sure what could be the issue for this.
@mbogunovic +1 we're having the same issue! Also using the import option a few times until the pages move to the correct structure.
Bug Description On Umbraco 8 installation (8.16) using uSync 8.10.4 As an administrator when configuring document types, when a document type is created under a composition document type, thus inheriting its properties, the
Level
property for the usync configContentType
element for that document type will correctly be 1 higher than its parent element.However, when manually editing this value afterwards in the usync file, for example needed if you decide to change inheritence structure later by adding an additional layer of inheritance, the
level
field of the umbracoNode is not updated as expected.While the umbraco backoffice is still usable, it does cause some issues when selecting nodes in the tree. Instead of highligting the affected document type node when selecting it, the tree collapses back to a lower level, since the level value is wrong.
To Reproduce Steps to reproduce the behavior:
BasePage
BasePage
create a new document type inheriting from it calledItemPage
itemPage
thanBasePage
BaseItemPage
ItemPage
BasePage
ItemPage
to the newly createdBaseItemPage
(Thus adding another layer of inheritance in between the existing document types)ItemPage
to be 1 higher, as it is now 1 step lower in the tree structureItemPage
, the value is unchanged, even though it has changed in the config fileExpected behavior The level value in the umbracoNode table in the database, should reflect the Level value in the usync config file after running the import