From 13e6a63bcefd3876409ea762889eb5bcad2d53eb Mon Sep 17 00:00:00 2001 From: bansi-evrig Date: Thu, 3 Nov 2022 12:14:50 +0530 Subject: [PATCH 1/5] added new configuration field for media path --- Model/Plugins/Store/Model/Store.php | 6 +++++- etc/adminhtml/system.xml | 9 +++++++-- etc/config.xml | 3 ++- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/Model/Plugins/Store/Model/Store.php b/Model/Plugins/Store/Model/Store.php index 3ae6a81..afa499e 100644 --- a/Model/Plugins/Store/Model/Store.php +++ b/Model/Plugins/Store/Model/Store.php @@ -53,7 +53,11 @@ public function afterGetBaseUrl( 'smimageoptimization/general/image_engine_url', ScopeInterface::SCOPE_STORE ); - $baseUrl = $baseUrl . '/media/'; + $mediaPath = $this->scopeConfig->getValue( + 'smimageoptimization/general/media_path', + ScopeInterface::SCOPE_STORE + ); + $baseUrl = $baseUrl . $mediaPath; } return $baseUrl; diff --git a/etc/adminhtml/system.xml b/etc/adminhtml/system.xml index 7a728bc..69c6822 100755 --- a/etc/adminhtml/system.xml +++ b/etc/adminhtml/system.xml @@ -6,7 +6,7 @@ --> - +
@@ -21,10 +21,15 @@ Magento\Config\Model\Config\Source\Yesno - + This url will change unsecure/base_media_url and secure/base_media_url. + + + Make sure you have add Media folder name and it start & end with '/' (slash) e.g. '/media/']]> +
+ diff --git a/etc/config.xml b/etc/config.xml index 31ef880..a32f0d5 100755 --- a/etc/config.xml +++ b/etc/config.xml @@ -12,7 +12,8 @@ + /media/ - \ No newline at end of file + From f1bf3951549d44ac1bc5e5433f402a48bb322dd6 Mon Sep 17 00:00:00 2001 From: bansi-evrig Date: Thu, 3 Nov 2022 15:16:48 +0530 Subject: [PATCH 2/5] removed existing configuration field comment --- etc/adminhtml/system.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/etc/adminhtml/system.xml b/etc/adminhtml/system.xml index 69c6822..fbd4efb 100755 --- a/etc/adminhtml/system.xml +++ b/etc/adminhtml/system.xml @@ -22,7 +22,6 @@ - This url will change unsecure/base_media_url and secure/base_media_url. From fcaa0c7f8179f80e5f933a44335d93e34259aa14 Mon Sep 17 00:00:00 2001 From: bansi-evrig Date: Thu, 3 Nov 2022 15:57:41 +0530 Subject: [PATCH 3/5] added required field for media path configuration --- etc/adminhtml/system.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/etc/adminhtml/system.xml b/etc/adminhtml/system.xml index fbd4efb..e51567a 100755 --- a/etc/adminhtml/system.xml +++ b/etc/adminhtml/system.xml @@ -26,6 +26,7 @@ Make sure you have add Media folder name and it start & end with '/' (slash) e.g. '/media/']]> + required-entry From 3f15e3a8cdd65ac9d9b84ca7b9bf79ecdd8074e5 Mon Sep 17 00:00:00 2001 From: bansi-evrig Date: Fri, 4 Nov 2022 15:07:33 +0530 Subject: [PATCH 4/5] added validation and comment for ImageEngine Delivery Address field --- etc/adminhtml/system.xml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/etc/adminhtml/system.xml b/etc/adminhtml/system.xml index e51567a..8e72526 100755 --- a/etc/adminhtml/system.xml +++ b/etc/adminhtml/system.xml @@ -22,10 +22,12 @@ + Enter the complete delivery address including `https://`. + required-entry validate-url - Make sure you have add Media folder name and it start & end with '/' (slash) e.g. '/media/']]> + Make sure you have add Media folder name and it start & end with '/' (slash) e.g. '/media/.']]> required-entry From d41b13f1c00e711245d0e9f32ed35e36f658e698 Mon Sep 17 00:00:00 2001 From: bansi-evrig Date: Fri, 4 Nov 2022 17:23:25 +0530 Subject: [PATCH 5/5] updated readme.md and composer.json --- README.md | 6 ++++++ composer.json | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 9767852..3c383da 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,12 @@ Follow the guide in the [official ImageEngine documentation](https://support.ima # Change Log +### Version : V1.0.23 +- Fixed hardcoded media path. +- Added new config text field for dynamic media folder. +- Added validation for address URL. + + ### Version : V1.0.22 - **Fixed:** Update client hint headers issue [#13](https://github.com/WURFL/magento-imageengine-extension/issues/13) - Issue solved for `img-src`,`script` and `style` are controlled with a content security policy. diff --git a/composer.json b/composer.json index 4b25181..79fad07 100755 --- a/composer.json +++ b/composer.json @@ -4,7 +4,7 @@ "require": { "php": "~7.1.0|~7.2.0|~7.3.0|~7.4.0|~8.1.0" }, - "version": "1.0.22", + "version": "1.0.23", "license": "MIT", "type": "magento2-module", "autoload": {