diff --git a/MediaGalleryUi/Model/AssetIndexer.php b/MediaGalleryUi/Model/AssetIndexer.php index 6f027f176d4a..968a0f995720 100644 --- a/MediaGalleryUi/Model/AssetIndexer.php +++ b/MediaGalleryUi/Model/AssetIndexer.php @@ -78,6 +78,7 @@ public function __construct( * Create MediaGallery asset and save it to database based on file information * * @param \SplFileInfo $item + * @throws \Exception */ public function execute(\SplFileInfo $item): void { @@ -94,6 +95,7 @@ public function execute(\SplFileInfo $item): void 'updated_at' => (new \DateTime())->setTimestamp($item->getMTime())->format('Y-m-d H:i:s'), 'width' => $width, 'height' => $height, + 'size' => $item->getSize(), 'content_type' => 'image/' . $item->getExtension() ] ] diff --git a/MediaGalleryUi/Model/UpdateAssetInGrid.php b/MediaGalleryUi/Model/UpdateAssetInGrid.php index d7913b0f4c4b..4a099ee2e00a 100644 --- a/MediaGalleryUi/Model/UpdateAssetInGrid.php +++ b/MediaGalleryUi/Model/UpdateAssetInGrid.php @@ -90,6 +90,7 @@ public function execute(AssetInterface $asset): void 'source' => $asset->getSource(), 'width' => $asset->getWidth(), 'height' => $asset->getHeight(), + 'size' => $asset->getSize(), 'created_at' => $asset->getCreatedAt(), 'updated_at' => $asset->getUpdatedAt(), 'keywords' => implode(",", $keywords) ?: null diff --git a/MediaGalleryUi/etc/db_schema.xml b/MediaGalleryUi/etc/db_schema.xml index 398240d1f056..835257f27819 100644 --- a/MediaGalleryUi/etc/db_schema.xml +++ b/MediaGalleryUi/etc/db_schema.xml @@ -16,6 +16,7 @@ + diff --git a/MediaGalleryUi/etc/db_schema_whitelist.json b/MediaGalleryUi/etc/db_schema_whitelist.json index 14b4ab187e9c..f3190a7ba194 100644 --- a/MediaGalleryUi/etc/db_schema_whitelist.json +++ b/MediaGalleryUi/etc/db_schema_whitelist.json @@ -9,6 +9,7 @@ "name": true, "width": true, "height": true, + "size": true, "created_at": true, "updated_at": true, "keywords": true, diff --git a/MediaGalleryUi/view/adminhtml/web/js/grid/columns/image/actions.js b/MediaGalleryUi/view/adminhtml/web/js/grid/columns/image/actions.js index f089d3cb5995..d8a529d466d9 100644 --- a/MediaGalleryUi/view/adminhtml/web/js/grid/columns/image/actions.js +++ b/MediaGalleryUi/view/adminhtml/web/js/grid/columns/image/actions.js @@ -70,7 +70,9 @@ define([ window.MediabrowserUtility.closeDialog(); throw 'Target element not found for content update'; } + targetElement.val(record['thumbnail_url']) + .data('size', record.size) .data('mime-type', record['content_type']) .trigger('change'); window.MediabrowserUtility.closeDialog();