From 6ff37a7c5e6e16a32b7cdc7f6b75c0c0f018fd00 Mon Sep 17 00:00:00 2001 From: Alyzeo LTD Date: Tue, 1 Feb 2022 19:21:43 +0100 Subject: [PATCH] Remove v7 option added to the configuration --- Block/Tag.php | 3 +++ CHANGELOG.md | 4 ++++ Helper/Config.php | 11 +++++++++++ README.md | 2 ++ composer.json | 2 +- etc/adminhtml/system.xml | 5 +++++ 6 files changed, 26 insertions(+), 1 deletion(-) diff --git a/Block/Tag.php b/Block/Tag.php index 93d0981..d8c4f98 100644 --- a/Block/Tag.php +++ b/Block/Tag.php @@ -64,6 +64,9 @@ public function getConfigToString(): string if ($this->config->isIgnoreStyleImgSize()) { $config .= 'ignoreStyleImgSize:true, '; } + if ($this->config->isRemoveV7()) { + $config .= 'apiVersion:null, '; + } if ($this->config->isCustomFunctionActive()) { $config .= 'processQueryString: function (props) ' . $this->config->getCustomFunction() . ', '; } diff --git a/CHANGELOG.md b/CHANGELOG.md index 99eb521..97c22b9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ All notable changes to this project will be documented in this file. +## [2.0.1] - 2022-02-01 + +* Remove "/v7" from the URL part option added + ## [2.0.0] - 2022-01-17 * Add a text field in the configuration to modify the URL for retrieving the Cloudimage library diff --git a/Helper/Config.php b/Helper/Config.php index 19b76f5..fcbe604 100644 --- a/Helper/Config.php +++ b/Helper/Config.php @@ -33,6 +33,7 @@ class Config extends AbstractHelper const XML_PATH_SCALEFLEX_CLOUDIMAGE_ADVANCED_IMAGE_QUALITY = 'scaleflex_cloudimage/advanced/image_quality'; const XML_PATH_SCALEFLEX_CLOUDIMAGE_ADVANCED_PROCESS_SVG = 'scaleflex_cloudimage/advanced/ignore_svg'; const XML_PATH_SCALEFLEX_CLOUDIMAGE_ADVANCED_LIBRARY_OPTIONS = 'scaleflex_cloudimage/advanced/library_options'; + const XML_PATH_SCALEFLEX_CLOUDIMAGE_ADVANCED_REMOVE_V7 = 'scaleflex_cloudimage/advanced/remove_v7'; /** * @return bool @@ -211,4 +212,14 @@ public function isIgnoreSvg() { return $this->scopeConfig->isSetFlag(self::XML_PATH_SCALEFLEX_CLOUDIMAGE_ADVANCED_PROCESS_SVG); } + + /** + * Ignore SVG images ? + * + * @return bool + */ + public function isRemoveV7() + { + return $this->scopeConfig->isSetFlag(self::XML_PATH_SCALEFLEX_CLOUDIMAGE_ADVANCED_REMOVE_V7); + } } diff --git a/README.md b/README.md index d7c11f7..0ee1178 100644 --- a/README.md +++ b/README.md @@ -97,6 +97,8 @@ This setting is for advanced users only and allows to inject a custom JS functio **(new) Custom Library Options**: Those optional parameters will be added to the request for each URL going through the Cloudimage acceleration infrastructure. It can allow you to force image formats, apply automatic transformations or watermarking, and might be used for troubleshooting purposes. (for advanced users only, please refer to the official [Cloudimage documentation here](https://docs/cloudimage.io) for the list of possible parameters) +**(new) Remove v7**: Removes the "/v7" part in URL format. Activate for token created after October 20th 2021. + ## 2. Integration "on-the-fly" in Magento templates diff --git a/composer.json b/composer.json index 7cbdb11..20b5bf5 100644 --- a/composer.json +++ b/composer.json @@ -7,7 +7,7 @@ "ext-libxml": "*" }, "type": "magento2-module", - "version": "2.0.0", + "version": "2.0.1", "license": "BSD-3-Clause", "authors": [ { diff --git a/etc/adminhtml/system.xml b/etc/adminhtml/system.xml index dfa8a4a..2fd6d1c 100644 --- a/etc/adminhtml/system.xml +++ b/etc/adminhtml/system.xml @@ -84,6 +84,11 @@ + + + Magento\Config\Model\Config\Source\Yesno + +