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 18
18
class Config
19
19
{
20
20
private const TABLE_CORE_CONFIG_DATA = 'core_config_data ' ;
21
+ private const XML_PATH_MEDIA_GALLERY_ENABLED = 'system/media_gallery/enabled ' ;
21
22
private const XML_PATH_ENABLED = 'system/media_gallery_renditions/enabled ' ;
22
23
private const XML_PATH_MEDIA_GALLERY_RENDITIONS_WIDTH_PATH = 'system/media_gallery_renditions/width ' ;
23
24
private const XML_PATH_MEDIA_GALLERY_RENDITIONS_HEIGHT_PATH = 'system/media_gallery_renditions/height ' ;
@@ -49,6 +50,16 @@ public function __construct(
49
50
*
50
51
* @return bool
51
52
*/
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
+ */
52
63
public function isEnabled (): bool
53
64
{
54
65
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(
91
91
$ storeId
92
92
];
93
93
94
- if (!$ this ->config ->isEnabled ()) {
94
+ if (!$ this ->config ->isEnabled () || ! $ this -> config -> isMediaGalleryEnabled () ) {
95
95
return $ arguments ;
96
96
}
97
97
You can’t perform that action at this time.
0 commit comments