File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
app/code/Magento/MediaGalleryRenditions Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change 1818class Config
1919{
2020 private const TABLE_CORE_CONFIG_DATA = 'core_config_data ' ;
21+ private const XML_PATH_MEDIA_GALLERY_ENABLED = 'system/media_gallery/enabled ' ;
2122 private const XML_PATH_ENABLED = 'system/media_gallery_renditions/enabled ' ;
2223 private const XML_PATH_MEDIA_GALLERY_RENDITIONS_WIDTH_PATH = 'system/media_gallery_renditions/width ' ;
2324 private const XML_PATH_MEDIA_GALLERY_RENDITIONS_HEIGHT_PATH = 'system/media_gallery_renditions/height ' ;
@@ -49,6 +50,16 @@ public function __construct(
4950 *
5051 * @return bool
5152 */
53+ public function isMediaGalleryEnabled (): bool
54+ {
55+ return $ this ->scopeConfig ->isSetFlag (self ::XML_PATH_MEDIA_GALLERY_ENABLED );
56+ }
57+
58+ /**
59+ * Should the renditions be inserted in the content instead of original image
60+ *
61+ * @return bool
62+ */
5263 public function isEnabled (): bool
5364 {
5465 return $ this ->scopeConfig ->isSetFlag (self ::XML_PATH_ENABLED );
Original file line number Diff line number Diff line change @@ -91,7 +91,7 @@ public function beforeExecute(
9191 $ storeId
9292 ];
9393
94- if (!$ this ->config ->isEnabled ()) {
94+ if (!$ this ->config ->isEnabled () || ! $ this -> config -> isMediaGalleryEnabled () ) {
9595 return $ arguments ;
9696 }
9797
You can’t perform that action at this time.
0 commit comments