File tree Expand file tree Collapse file tree 2 files changed +16
-3
lines changed
view/adminhtml/web/js/components/grid/column Expand file tree Collapse file tree 2 files changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -58,7 +58,13 @@ public function __construct(
5858 */
5959 public function execute (int $ adobeId ): array
6060 {
61- $ mediaGalleryId = $ this ->getAssetByAdobeId ->execute ([$ adobeId ])[$ adobeId ]->getMediaGalleryId ();
61+ $ mediaGalleryAsset = $ this ->getAssetByAdobeId ->execute ([$ adobeId ]);
62+
63+ if (!isset ($ mediaGalleryAsset [$ adobeId ])) {
64+ return [];
65+ }
66+
67+ $ mediaGalleryId = $ mediaGalleryAsset [$ adobeId ]->getMediaGalleryId ();
6268 $ asset = $ this ->getMediaGalleryAssetsById ->execute ([$ mediaGalleryId ]);
6369
6470 return $ this ->objectProcessor ->buildOutputDataArray (current ($ asset ), AssetInterface::class);
Original file line number Diff line number Diff line change @@ -63,11 +63,18 @@ define([
6363 this . _super ( ) . initView ( ) ;
6464 $ ( window ) . on ( 'fileDeleted.enhancedMediaGallery' , function ( ) {
6565 this . reloadAdobeGrid ( ) ;
66- this . hide ( ) ;
6766 } . bind ( this ) ) ;
6867 $ ( window ) . on ( 'folderDeleted.enhancedMediaGallery' , function ( ) {
68+ this . actions ( ) . getAssetDetails ( this . displayedRecord ( ) . id ) . then ( function ( assetDetails ) {
69+ var record = this . displayedRecord ( ) ;
70+
71+ if ( assetDetails . length === 0 ) {
72+ record [ 'is_downloaded' ] = 0 ;
73+ this . displayedRecord ( record ) ;
74+ }
75+ } . bind ( this ) ) ;
76+
6977 this . reloadAdobeGrid ( ) ;
70- this . hide ( ) ;
7178 } . bind ( this ) ) ;
7279
7380 return this ;
You can’t perform that action at this time.
0 commit comments