Troubleshooting SCCH

General troubleshooting help

To help find solutions for errors or problems in general, you can do the following:

  • Check the log in the Sitecore Content Hub for the created trigger. Trigger the event that fires the trigger and then check the log as follows:

    • On the menu ribbon, click Manage .

    • Click Actions.

    • Click the Auditing tab.

  • Check posted messages in the Azure Service Bus.

  • Check the Sitecore log file and scan for any CMP or DAM related errors.

You browse a Sitecore DAM image field type link, and you get a 404 not found error.

To solve this problem:

  1. In the Sitecore Launchpad, click Desktop, and switch from Master database to Core database.

  2. In the Content editor, navigate to sitecore/system/Field types/Simple types/Image.

  3. On the Content tab, in the Data section, clear the Control field. Save the item.

The connector does not change any data values or formats when it syncs data from the Content Hub rich text editor field to the Sitecore rich text editor. The XHTML validation in the Sitecore rich text editor may highlight the error:

XHTML validation error about incorrect formatting attributes in the Sitecore rich text editor

To solve this problem:

  1. In the Content editor, look for the following items:

    • /sitecore/system/Settings/Validation Rules/Field Types/Rich Text

    • /sitecore/system/Settings/Validation Rules/Global Rules

  2. For all validation rules under these two items, in the Selected list, click Is Xhtml to move it to the All list.

    Dialog for adding validation rules to items
  3. Save the item.

Azure deployment throws Could not load file or assembly 'Microsoft.Extensions.Caching.Abstractions' error

The Sitecore Azure ToolKit (SAT) requires minimum dependency to perform the config transformation. After you have applied the SCCH package to the instance, the bin\scch folder has all the necessary assemblies.

To solve the problem:

  1. In the Azure App Service Editor, open the Web.config file.

  2. In the assemblyBinding node, add the following code:

    RequestResponse
    <dependentAssembly>
        <assemblyIdentity name="Microsoft.Extensions.Caching.Abstractions" publicKeyToken="adb9793829ddae60" />
        <bindingRedirect oldVersion="0.0.0.0-3.1.14.0" newVersion="3.1.14.0" />
        <codeBase version="2.1.2.0" href="bin/Microsoft.Extensions.Caching.Abstractions.dll" />
        <codeBase version="3.1.5.0" href="bin/Microsoft.Extensions.Caching.Abstractions.dll" />
        <codeBase version="3.1.14.0" href="bin/scch/Microsoft.Extensions.Caching.Abstractions.dll" />
    </dependentAssembly>
  3. Save and refresh the Azure App Service Editor.

Empty Sitecore Attribute or Content Hub Mapping Field on Item error

You might see an Empty Sitecore Attribute or Content Hub Mapping Field on Item error in the log after you click Select in a DAM public link selection window.

When you select the public link, DAM retrieves the attribute mapping configuration item. By default, Sitecore uses the English version field value in the attribute mapping configuration item. If you use a language other than English, for example Japanese, in the content editor, in the Master DB/System/Modules/DAM/Config/Mapping item, enter the language value for the Japanese language version.

SXA fields do not work with DAM functionality

Although DAM functionality is not available for SXA, when the DAM connector is installed, all image types in Sitecore have the Browse Sitecore DAM enabled. You can use a workaround to enable SXA to utilize DAM functionality.

In the following procedure, we use the SXA favicon field as an example, but the same applies to other SXA fields that have DAM functionality. The main reason why the DAM image link does not work is because the MediaManager.GetMediaUrl() method is utilized when the favicon field value is being retrieved by SXA.

To resolve this problem:

  1. Patch the Sitecore.XA.Feature.SiteMetadata.Extensions.FieldExtensions.GetImageUrl() method or create a new extension class using the following method:

    RequestResponse
    public static class MediaExtension
         {
             public static string GetImageUrl(this Field field, Item item, ID fieldId, bool includeServerUrl = true)
             {
                 var imageUrl = string.Empty;
                 if (field != null)
                 {
                     var imageField = (ImageField)field;
                     if (imageField != null)
                    {
                         if (imageField.MediaItem == null)
                         {
                             XmlField imageDAMField = item?.Fields[fieldId];
                             string src = imageDAMField.GetAttribute("src");
                             return src;
                         }
                         else
                         {
                             var urlOptions = new MediaUrlBuilderOptions();
                             urlOptions.AlwaysIncludeServerUrl = includeServerUrl;
                             return MediaManager.GetMediaUrl(imageField.MediaItem, urlOptions);
                         }
                     }
                 }
                 return imageUrl;
             }
     } 
  2. Patch the Sitecore.XA.Feature.SiteMetadata.Repositories.Favicon.FaviconRepository.GetFaviconHref() method to use the following method extension:

    RequestResponse
    public virtual string GetFaviconHref(Item contextItem)
             {
                 var faviconHref = string.Empty;
                 var settingsItem = GetSettingsItem(contextItem);
                 var faviconField = settingsItem.Fields[Templates._Favicon.Fields.Favicon];
                 if (faviconField != null)
                 {
                     faviconHref = faviconField.GetImageUrl(settingsItem, faviconField.ID, false);
                 }
                 return faviconHref;
             
  3. In the Sitecore.XA.Feature.SiteMetadata.config file, add the FaviconRepository repository (or your custom repository) to the implementation. For example:

    RequestResponse
    <register serviceType="Sitecore.XA.Feature.SiteMetadata.Repositories.Favicon.IFaviconRepository, Sitecore.XA.Feature.SiteMetadata" implementationType="<customFaviconRepository>, <customAssembly>" lifetime="Singleton" />

Known issues with the DAM connector

The following table explains some of the issues you might encounter when you use the DAM functionality in SCCH, and how to resolve them.

Area where issue appears

Description

Workaround

Content type

When the content type of an asset is changed in Content Hub DAM, the change is not reflected in Sitecore. The rendition in Sitecore is therefore not shown.

n/a

Image Properties

In the Content Editor, right-clicking on an image shows two options: Image Map Editor and Properties. If either is selected and you click on the Image Manager icon, the Media Library that is opened is not the Sitecore DAM library but the sitecore/media library. There is no option to change the media library.

n/a

Clear the image field

Content Editor: With a Sitecore DAM image in the image field, clicking the Clear link does not clear the image field correctly. The thumbnail is cleared, but the URL remains.

Click Save to resolve the issue.

Change an image

Content Editor: With a Sitecore DAM image inserted by clicking Browse and selecting an image from the sitecore/media library, the image field is not cleared correctly.

Clear the field by using the clear link, save the item and then select a new image.

Clear the image field

Experience Editor: Clearing an image by clicking Remove the image without saving does not clear the field, even though the image is not displayed in the Experience Editor.

Click Save to resolve the issue.

Change from DAM to media library image

Experience Editor: When you insert an image from Sitecore DAM, then click Choose an image and insert a new image from the sitecore/media library to replace the Sitecore DAM image, the field is not cleared correctly.

Click Remove image , click Save, then insert an image from the sitecore/media library.

SXA

SXA fields do not work with DAM functionality.

Refer to this workaround.

SXA

If SXA is installed, and the IFrame is opening, the error MAsset Command is not implemented is returned and the IFrame fails to open.

This issue is resolved by updating the SXA config file Sitecore.XA.Feature. ContentTokens.config in the App_Config\Modules\SXA\Feature\ folder. In front of the Command Script tag, prepend the following SXA key attribute:

<script key = “SXA” src=”/sitecore/shel l/Controls/Rich Text Edit/ Insert Content Token Command.js” language=“Javascript”/>

Behaviour Rich Text Editor

When inserting a video in the Rich Text Editor using the Design mode, the video cannot be moved or deleted. It can only be played.

However, two console errors are thrown.

Switch to the HTML mode and adjust the video element as necessary.

Behaviour Rich Text Editor

When an item containing only a video is saved and reopened using the Design mode, the item is frozen and cannot be edited.

Switch to the HTML mode and add an element as necessary. This will unfreeze the item.

Login Procedure

As part of the login procedure, the window will refresh, and the content/experience editor will close without any warning message.

Save all changes prior to continuing to the login. Once you are logged in the window will not refresh again.

Sitecore DAM login with Chrome in Incognito mode

In Sitecore Content Editor, if you use Chrome in Incognito mode, when you click Browse Sitecore DAM and attempt to sign in, the Sign In dialog box opens again asking for your credentials.

In the Chrome browser, set cookies option to Allow all cookies. Refer to the browser documentation for details.

Do you have some feedback for us?

If you have suggestions for improving this article,