Content Hub Tip #10: Content Hub - Disable copying relation to Draft asset

 

Content Hub Tips logo

The DAM module of Content Hub supports the process of creating a Draft version of the Asset. When the Draft version is created, all properties and relations are copied over from the existing asset. This can become a problem if you're using a One-to-Many or One-to-One relation. 

In order to resolve this issue, you can configure the Draft process to skip certain properties and or relations. You can configure this in the Management -> Settings -> Drafts -> DraftSetting.

Draft settings

By default the JSON looks like this:
{
  "entityDefinitions": [
    {
      "definition": "M.Asset",
      "skipProperties": [],
      "skipRelations": [
        "AssetToPublicLink"
      ]
    }
  ]
}

In here, you can add the relations you would like to skip. 

Important: The 4.* versions contain a flaw that doesn't allow you to create a Draft version of an Asset when an Usage entity is connected to the Asset. This bug is has been filled under MONE-31095.

Draft issue

To solve the issue, add the AssetToUsage relation to the skipped relation to copy when creating a Draft. The JSON will look like this:
{
  "entityDefinitions": [
    {
      "definition": "M.Asset",
      "skipProperties": [],
      "skipRelations": [
        "AssetToPublicLink",
        "AssetToUsage"
      ]
    }
  ]
}

Until next time!