U4-5712 - Inherited Document Types and Document Type Compositions can be confusing

Created by Jeroen Breuer 29 Oct 2014, 09:39:36 Updated by Laurence Gillian 09 Mar 2015, 13:24:56

Is duplicated by: U4-5725

Relates to: U4-5724

Relates to: U4-5725

Relates to: U4-5748

Relates to: U4-5755

Relates to: U4-5769

I have a Search Document Type that inherits from the Base and Menu Document Type. When I look at the compositions of the Search Document Type I can see that the Base and Menu Document Type are checked (see attachment 1). This gives the assumption that if I uncheck the Menu compostion the Search Document Type doesn't inherit from Menu anymore and will only inherit from Base, but this is not the case. Unchecking the Base or Menu composition checkboxes doesn't change anything. It will still inherit from Menu, but if I look at a node with the Search Document Type the properties are gone. I tried to generate a model with the [Models Builder|https://github.com/zpqrtbnk/Zbu.ModelsBuilder], but the properties are available there because it still inherits from the Menu Document Type.

When I try to recheck the Menu checkbox composition I get the following error (see attachment 2):

InvalidCompositionException - ContentType with alias 'Menu' was added as a Compsition to ContentType with alias 'Search', but there was a conflict on the PropertyType alias 'seo'. PropertyTypes must have a unique alias across all Compositions in order to compose a valid ContentType Composition.

So the properties are gone, but I can't add them back again.

If I add a composition Document Type which it doesn't inherit from those base Document Types it seems to work, but doing anything with the base Document Types seems broken.

So is it still not possible to move a Document Type to another parent?

3 Attachments

Comments

Jeroen Breuer 29 Oct 2014, 09:49:22

The properties on the node are gone, but the tab is still there. See attachment.


Stephan 04 Nov 2014, 08:46:36

To make it short: the composition feature in the content type editor is broken. Working on it. Also, not making U4-5724 a duplicate now because it is about content, not content type.


Jeroen Breuer 04 Nov 2014, 08:50:11

Great that you're working on it. Will it be possible to move a Document Type to another parent when you're done? And if yes will that have any affect on the models builder?


Stephan 04 Nov 2014, 08:55:27

@jbreuer In ''theory'' it should work (though the models would need to be entirely re-generated) but that's theory. In practice I'm currently trying to assess what works and what does not work in the backend, and what can be fixed quickly and what cannot.

Various controls are missing... you cannot be a child of a content type and not have that content type in your compositions list, so we need a better "parent" management, and I still don't know whether it's only a UI thing or backend.


Stephan 04 Nov 2014, 10:13:52

OK, the exception that you see when you add the composition again, might be a UI issue. See, you should ''not'' be able to remove '''Base''' from the composition while keeping '''Menu''' since '''Menu''' implies '''Base''' - and in fact the service does ''not'' remove it. But the UI still assumes it's been removed, and lets you add it again, which fails.


Stephan 04 Nov 2014, 11:21:58

OK - the backend seems to be OK, as far as content types management is concerned, so it's a matter of figuring out what can and cannot be done in the UI. Eg, if ContentType_A is checked, and it inherits from ContentType_B, then you shouldn't be allowed to uncheck ContentType_B. Also, you should ''not'' be allowed to uncheck the parent, and we prob. need another way to change the parent.

Todo - need to check whether the backend is OK re. contents.


Stephan 04 Nov 2014, 12:32:08

Note to self: backend is OK with compositions at content level, but does not refresh the content cache properly (basically ignores compositions).


Robert Foster 04 Nov 2014, 21:21:10

One other thing - Exporting Document Types with compositions doesn't export the full definition... there's no support for mixins at this point in time it seems.


Jeroen Breuer 05 Nov 2014, 09:34:47

I haven't tested this yet, but I wonder when you add a composition to a parent Document Type everything works for the child Document Types.


Morten Christensen 17 Nov 2014, 12:01:11

Jeroen, any chance you can export/package the doc type structure before the move, which caused the exception in the issue? Would be great to test with the same structure, hierachy, etc.


Jeroen Breuer 18 Nov 2014, 09:27:40

I could send you the version which I tested in, but that version is already broken. Still runs on 7.2 beta 1.


Morten Christensen 18 Nov 2014, 09:30:50

I wanted the version from before it was broken ;) Guess I'll just have to create something similar to your screenshots then.


Jeroen Breuer 18 Nov 2014, 09:41:16

It's probably easier to just download the Hybrid Framework: https://github.com/jbreuer/Hybrid-Framework-for-Umbraco-v7-Best-Practises

It has most of the document type predefined in the [database|https://github.com/jbreuer/Hybrid-Framework-for-Umbraco-v7-Best-Practises/tree/master/SQLServerBackup] which is included in the zip. All you have to do is upgrade it from 7.1.6 on which it currently runs.


Jeroen Breuer 17 Dec 2014, 16:16:22

Should this issue be closed now that 7.2 is out?


Stephan 17 Dec 2014, 16:20:01

Will close it - but I need to cleanup all the related issues too.


Laurence Gillian 09 Mar 2015, 13:24:56

NB. If you try to create a property that already exists on a child, a very cryptic error message is displayed.


Priority: Major

Type: Bug

State: Closed

Assignee: Stephan

Difficulty: Normal

Category:

Backwards Compatible: True

Fix Submitted:

Affected versions: 7.2.0

Due in version:

Sprint:

Story Points:

Cycle: