U4-7641 - Can't copy a document type with new document type tree

Created by Andy Butland 04 Jan 2016, 15:47:11 Updated by Warren Buckley 08 Mar 2016, 09:38:23

Subtask of: U4-112

With prior versions a document type could be copied to a new one and then amended. This doesn't look to be possible any more and instead they need to be created from scratch. Obviously easier if compositions are used but still would often be good to be able to copy to create a new one.


Jason Thomas 03 Feb 2016, 16:53:38

I am have this issue also. I am getting a SQL error that there is a duplicate key issue. See this post for error, seems I am not the only one having the issue.


Looks like copy process is trying to copy the unique id as well which is suspect is the issue.

Stephan 18 Feb 2016, 16:15:12

The SQL error means that copying might not work in 7.3 - that's one issue. And then the feature has been entirely removed in 7.4 - that's another issue.

Dealing with 7.4... how should copy work with regards to parents: if a content type is copied ''from'' a parent content type, I assume that the copy is not composed of the parent anymore? And it is copied ''to'' a parent content type, I assume that the copy is composed of the new parent?

Stephan 18 Feb 2016, 16:16:14

Can reproduce the 7.3 issue.

Stephan 18 Feb 2016, 16:59:55

7.3 issue fix: missing "_key = Guid.Empty;" in Entity:ResetIdentity().

Andy Butland 18 Feb 2016, 17:08:30

''If a content type is copied from a parent content type, I assume that the copy is not composed of the parent anymore? And it is copied to a parent content type, I assume that the copy is composed of the new parent?'' That sounds correct to me from an expectations point of view.

Stephan 25 Feb 2016, 12:53:36

7.4 implementation: at the moment the Move action only allows moving to a container (not to a content type). If we want to be consisted, the Acopy action would only allows copying to a container (not to a content type). Thoughts?

Also: as of 7.3 it is not possible to copy media types. Not sure why, will see if it's difficult to add.

Stephan 25 Feb 2016, 14:28:55

PR https://github.com/umbraco/Umbraco-CMS/pull/1146

Adds copy of content types to a container. If the content type has a parent content type, the composition is removed. Other compositions are left unchanged. A new unique alias is assigned to the copy. Children are not copied.

Adding copy to another content type... would make sense if we also added move to another content type, out of the scope of this issue.

Stephan 25 Feb 2016, 15:02:39

Have updated the PR to add copy of media types to a container.

Still having an issue though... with content types the tree is updated, but not with media types?

Stephan 25 Feb 2016, 15:27:14

OK, sorted it out, now up for review.

Review: try to copy content/media types to root or to any folder. Should work. Should not copy children, should preserve compositions except for the parent.

Stephan 26 Feb 2016, 10:13:26

OK looking into it.

Stephan 26 Feb 2016, 10:56:23

See discussion on Slack, we are not opening the target in the tree - that's how it already worked for Move, and that's how it works for Move and Copy for content items in the content tree. So we're consistent accross the UI.

As for the weird behavior you're mentionning - a commit was missing in the PR, updated now. Back to review!

Stephan 08 Mar 2016, 09:35:54

@warren.buckley you haven't merged the PR though?

Priority: Normal

Type: Bug

State: Fixed


Difficulty: Normal


Backwards Compatible: True

Fix Submitted:

Affected versions: 7.4.0, 7.3.7

Due in version: 7.4.2

Sprint: Sprint 10

Story Points: