Copied to clipboard

Flag this post as spam?

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


  • James Jackson-South 489 posts 1747 karma points c-trib
    Feb 18, 2016 @ 23:22
    James Jackson-South
    0

    Cannot Copy Document Type

    Using v7.3.7 I'm getting the following error when attempting to copy a document type.

    Can anyone give me a walkthrough on how to correct this. I'm like a bull in a china shop when it comes to DB's

    Cannot insert duplicate key row in object 'dbo.cmsPropertyType' with unique index 'IX_cmsPropertyTypeUniqueID'. The duplicate key value is (834ae868-b4a6-4efe-bf5a-b8457d99d40d). The statement has been terminated.

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.Data.SqlClient.SqlException: Cannot insert duplicate key row in object 'dbo.cmsPropertyType' with unique index 'IX_cmsPropertyTypeUniqueID'. The duplicate key value is (834ae868-b4a6-4efe-bf5a-b8457d99d40d). The statement has been terminated.

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

    Stack Trace:

    [SqlException (0x80131904): Cannot insert duplicate key row in object 'dbo.cmsPropertyType' with unique index 'IX_cmsPropertyTypeUniqueID'. The duplicate key value is (834ae868-b4a6-4efe-bf5a-b8457d99d40d).
    The statement has been terminated.]
       System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) +3279044
       System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) +791
       System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) +4927
       System.Data.SqlClient.SqlDataReader.TryConsumeMetaData() +92
       System.Data.SqlClient.SqlDataReader.get_MetaData() +102
       System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +552
       System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, SqlDataReader ds, Boolean describeParameterEncryptionRequest) +3114
       System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite) +554
       System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) +98
       System.Data.SqlClient.SqlCommand.ExecuteScalar() +374
       StackExchange.Profiling.Data.ProfiledDbCommand.ExecuteScalar() in c:\Code\github\SamSaffron\MiniProfiler\StackExchange.Profiling\Data\ProfiledDbCommand.cs:311
       Umbraco.Core.Persistence.<>c__DisplayClassa.<ExecuteScalarWithRetry>b__9() +75
       Umbraco.Core.Persistence.FaultHandling.RetryPolicy.ExecuteAction(Func`1 func) +383
       Umbraco.Core.Persistence.Database.Insert(String tableName, String primaryKeyName, Boolean autoIncrement, Object poco) +3113
       Umbraco.Core.Persistence.Database.Insert(Object poco) +64
       Umbraco.Core.Persistence.Repositories.ContentTypeBaseRepository`1.PersistNewBaseContentType(ContentTypeDto dto, IContentTypeComposition entity) +3140
       Umbraco.Core.Persistence.Repositories.ContentTypeRepository.PersistNewItem(IContentType entity) +368
       Umbraco.Core.Cache.FullDataSetRepositoryCachePolicy`2.CreateOrUpdate(TEntity entity, Action`1 persistMethod) +326
       Umbraco.Core.Persistence.Repositories.RepositoryBase`2.PersistNewItem(IEntity entity) +286
       Umbraco.Core.Persistence.UnitOfWork.PetaPocoUnitOfWork.Commit(Action`1 transactionCompleting) +157
       Umbraco.Core.Services.ContentTypeService.Save(IContentType contentType, Int32 userId) +343
       Umbraco.Core.Services.ContentTypeService.Copy(IContentType original, String alias, String name, IContentType parent) +627
       umbraco.dialogs.moveOrCopy.HandleDocumentTypeCopy() +394
       System.Web.UI.WebControls.Button.OnClick(EventArgs e) +11757857
       System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +150
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +6016
    
  • Stephen 767 posts 2273 karma points c-trib
    Feb 19, 2016 @ 07:44
  • James Jackson-South 489 posts 1747 karma points c-trib
    Feb 21, 2016 @ 06:28
    James Jackson-South
    0

    Good to know Stephen thanks!

  • Wietze Strik 27 posts 131 karma points
    Mar 02, 2016 @ 12:37
    Wietze Strik
    0

    I'm working with 7.4 and the copy function is completely gone. I read the issue, does that mean it wouldn't be possible anymore to copy? This would be a big issue for me.

  • Stephen 767 posts 2273 karma points c-trib
    Mar 02, 2016 @ 14:27
    Stephen
    0

    Copy is to be back, prob in 7.4.2.

  • Wietze Strik 27 posts 131 karma points
    Mar 02, 2016 @ 15:29
    Wietze Strik
    0

    Nice, thx for the reply

  • Dan Diplo 1554 posts 6205 karma points MVP 6x c-trib
    Apr 18, 2016 @ 09:21
    Dan Diplo
    1

    For anyone else hitting this in 7.3.x then one way around is to use the Export / Import Document type feature.

    Right-click the doc type you wish to copy and select Export Document Type. This creates a .udt file that is essentially an XML representation of your doc type. Open it in an editor and change the alias and name in <Info> section (and any other bits you wish to be different) and then save.

    Then right-click the root Doc Types folder and select Import Document Type and choose your file. Reload nodes and you should be good.

  • Ian 23 posts 113 karma points
    Jun 14, 2016 @ 12:24
    Ian
    0

    Hi Dan, are there any issues with Export + Import?

    I notice the udt's xml has ids in there, eg:

      <Tabs>
        <Tab>
          <Id>1063</Id>
          <Caption>Content</Caption>
          <SortOrder>0</SortOrder>
        </Tab>   
      </Tabs>
    

    Do those ids have to be changed? Thanks

  • Ian 23 posts 113 karma points
    Jun 14, 2016 @ 12:34
    Ian
    0

    Looks like they get updated on import

Please Sign in or register to post replies

Write your reply to:

Draft