Broken preview thumbnails might be shown when browsing for a media item using the Select Media dialog. For example:
The issue occurs for versioned media items that do not have a version in the default language. The issue affects both the List View and the Tree View. The following message can be found in the Sitecore logs:
ERROR Application error.
Exception: System.ObjectDisposedException
Message: Cannot access a closed file.
Source: mscorlib
at System.IO.__Error.FileNotOpen()
at System.IO.FileStream.get_Length()
at Sitecore.Resources.Media.Streaming.RangeRetrievalResponse.WriteFullContent(HttpContext context, Stream fileContent)
at Sitecore.Resources.Media.MediaRequestHandler.DoProcessRequest(HttpContext context, MediaRequest request, Media media)
at Sitecore.Resources.Media.MediaRequestHandler.ProcessRequest(HttpContext context)
To resolve the issue, upgrade your solution to Sitecore XP 10.4.0 or later.
To mitigate the issue:
<site_root>\sitecore\shell\client\Business Component Library\Layouts\Renderings\ListsAndGrids\TreeViews\ItemTreeView.js
if (item.$icon && item.$icon.indexOf(".ashx") > 0 && item.$icon.indexOf("la=") === -1 ) {to:
item.$icon += "&la=" + this.model.get("contentLanguage");
}
if (item.$mediaurl && item.$mediaurl.indexOf(".ashx") > 0 && item.$mediaurl.indexOf("la=") === -1 ) {
item.$mediaurl += "&la=" + this.model.get("contentLanguage");
}
/* Fix for 539825 */
if (item.$icon && item.$icon.indexOf("la=") === -1 ) {
item.$icon += "&la=" + this.model.get("contentLanguage");
}
if (item.$mediaurl && item.$mediaurl.indexOf("la=") === -1 ) {
item.$mediaurl += "&la=" + this.model.get("contentLanguage");
}
/* End of fix for 539825 */
<site_root>\sitecore\shell\client\Business Component Library\Layouts\Renderings\ListsAndGrids\ListControls\ListControl.js