SXA 1.5 hotfix: UploadMediaDialog

Reading time ~1 minute

How to solve the issue with UploadMediaDialog dialog while using Sitecore Experience Accelerator 1.5

Problem description

If you are using Sitecore Experience Accelerator 1.5 you might notice problems with UploadMediaDialog dialog. When you try to change upload location nothing will happen and error will appear in the browser console.

Console output:

UploadMediaDialog.js:17 Uncaught TypeError: Cannot read property 'viewModel' of undefined
    at child.<anonymous> (http://sxa15/sitecore/shell/client/Applications/Dialogs/UploadMediaDialog.js:17:42)
    at http://sxa15/sitecore/shell/client/Speak/Assets/lib/core/1.1/sitecore-1.0.2.js:1565:40
    at Array.forEach (<anonymous>)
    at Function._.each._.forEach (http://sxa15/sitecore/shell/client/Speak/Assets/lib/core/1.1/deps/underscore/underscore.1.4.4.js:78:11)
    at child.click (http://sxa15/sitecore/shell/client/Speak/Assets/lib/core/1.1/sitecore-1.0.2.js:1563:13)
    at Object.model.viewModel.(anonymous function) [as click] (http://sxa15/sitecore/shell/client/Speak/Assets/lib/core/1.1/sitecore-1.0.2.js:646:33)
    at HTMLButtonElement.<anonymous> (http://sxa15/sitecore/shell/client/Speak/Assets/lib/core/1.1/deps/ko/knockout-2.2.1.js:2318:66)
    at HTMLButtonElement.dispatch (http://sxa15/sitecore/shell/client/Speak/Assets/lib/core/1.1/deps/jQuery/jquery-2.1.1.js:4409:9)
    at HTMLButtonElement.elemData.handle (http://sxa15/sitecore/shell/client/Speak/Assets/lib/core/1.1/deps/jQuery/jquery-2.1.1.js:4095:28)

Please go to the next section and see what you can do to mitigate the issue.

Solution

Important: Package can be installed both on Sitecore 8.2 and 9.0

Details

This package will install single item in core database.

  • items\core\sitecore\client\Applications\Dialogs\UploadMediaDialog - overwrite previous version of an item. It adds one missing SPEAK rendering and modifies PageCode value

    • Additional Text type rendering with id SxaSiteMediaLibrary

    • Page Code:

from

Sitecore.Speak.Applications.UploadMediaDialog, Sitecore.Speak.Applications

to

Sitecore.XA.Foundation.Multisite.Speak.Applications.UploadMediaDialog, Sitecore.XA.Foundation.Multisite

Summary

The post will be updated once the fix for the issue will be delivered with the next public release of SXA.

Asset Optimizer configuration

Explanation of different configuration options of SXA Asset Optimizer Continue reading

Items as resources and Unicorn

Published on November 21, 2021

Sitecore Extensions version 3.4 released

Published on November 07, 2020