diff --git a/Controller/Adminhtml/Ajax/RetrieveImage.php b/Controller/Adminhtml/Ajax/RetrieveImage.php
index c9a3e2e..4c5164c 100644
--- a/Controller/Adminhtml/Ajax/RetrieveImage.php
+++ b/Controller/Adminhtml/Ajax/RetrieveImage.php
@@ -17,6 +17,7 @@
use Magento\Framework\Validator\AllowedProtocols;
use Magento\MediaStorage\Model\File\Validator\NotProtectedExtension;
use Magento\MediaStorage\Model\ResourceModel\File\Storage\File as FileUtility;
+use Magento\PageBuilder\Controller\Adminhtml\ContentType\Image\Upload as PageBuilderContentTypeUpload;
use Magento\Store\Model\StoreManagerInterface;
use Magento\Theme\Model\Design\Config\FileUploader\FileProcessor;
@@ -196,6 +197,9 @@ protected function getBaseTmpMediaPath()
case 'design_config_fileUploader':
$baseTmpMediaPath = 'tmp/' . FileProcessor::FILE_DIR;
break;
+ case 'pagebuilder_contenttype':
+ $baseTmpMediaPath = PageBuilderContentTypeUpload::UPLOAD_DIR;
+ break;
case 'category_image':
$baseTmpMediaPath = 'catalog/tmp/category';
break;
@@ -213,6 +217,7 @@ protected function getLocalTmpFileName($remoteFileUrl)
{
$localFileName = Uploader::getCorrectFileName(basename($remoteFileUrl));
switch ($this->getRequest()->getParam('type')) {
+ case 'pagebuilder_contenttype':
case 'design_config_fileUploader':
case 'category_image':
$localTmpFileName = DIRECTORY_SEPARATOR . $localFileName;
diff --git a/Controller/Adminhtml/Cms/Wysiwyg/Images/Upload.php b/Controller/Adminhtml/Cms/Wysiwyg/Images/Upload.php
index db33c81..ea5f17e 100644
--- a/Controller/Adminhtml/Cms/Wysiwyg/Images/Upload.php
+++ b/Controller/Adminhtml/Cms/Wysiwyg/Images/Upload.php
@@ -3,13 +3,14 @@
namespace Cloudinary\Cloudinary\Controller\Adminhtml\Cms\Wysiwyg\Images;
use Cloudinary\Cloudinary\Core\ConfigurationInterface;
+use Cloudinary\Cloudinary\Model\Framework\File\Uploader;
use Cloudinary\Cloudinary\Model\MediaLibraryMapFactory;
use Magento\Backend\App\Action\Context;
use Magento\Catalog\Model\Product\Media\Config;
use Magento\Framework\App\Filesystem\DirectoryList;
+use Magento\Framework\App\Filesystem\DirectoryResolver;
use Magento\Framework\Controller\Result\JsonFactory;
use Magento\Framework\Exception\LocalizedException;
-use Cloudinary\Cloudinary\Model\Framework\File\Uploader;
use Magento\Framework\Filesystem;
use Magento\Framework\HTTP\Adapter\Curl;
use Magento\Framework\Image\AdapterFactory;
@@ -100,7 +101,7 @@ class Upload extends \Magento\Cms\Controller\Adminhtml\Wysiwyg\Images\Upload
* @param Context $context
* @param Registry $coreRegistry
* @param JsonFactory $resultJsonFactory
- * @param \Magento\Framework\App\Filesystem\DirectoryResolver|null $directoryResolver
+ * @param DirectoryResolver|null $directoryResolver
* @param DirectoryList $directoryList
* @param Config $mediaConfig
* @param Filesystem $fileSystem
@@ -116,7 +117,7 @@ public function __construct(
Context $context,
Registry $coreRegistry,
JsonFactory $resultJsonFactory,
- $directoryResolver = null,
+ DirectoryResolver $directoryResolver = null,
DirectoryList $directoryList,
Config $mediaConfig,
Filesystem $fileSystem,
diff --git a/Model/Api/ProductGalleryManagement.php b/Model/Api/ProductGalleryManagement.php
index 138ec50..be8cd80 100644
--- a/Model/Api/ProductGalleryManagement.php
+++ b/Model/Api/ProductGalleryManagement.php
@@ -323,7 +323,8 @@ public function addItems($items)
$result["items"][$i]["message"] = $this->configuration->isEnabledProductgalleryApiQueue() ? "The item was added to the queue." : "success";
$this->processOrQueue(
(isset($item["url"])) ? $item["url"] : null,
- (isset($item["sku"])) ? $item["sku"] : null(isset($item["publicId"])) ? $item["publicId"] : null,
+ (isset($item["sku"])) ? $item["sku"] : null,
+ (isset($item["publicId"])) ? $item["publicId"] : null,
(isset($item["roles"])) ? $item["roles"] : null,
(isset($item["label"])) ? $item["label"] : null,
(isset($item["disabled"])) ? $item["disabled"] : null,
diff --git a/Model/Configuration.php b/Model/Configuration.php
index 0ca75b1..bf20c1b 100644
--- a/Model/Configuration.php
+++ b/Model/Configuration.php
@@ -618,7 +618,7 @@ public function parseCloudinaryUrl($url, $publicId = null)
*
* @return array
*/
- public function mbParseUrl($url, $component=-1)
+ public function mbParseUrl($url, $component = -1)
{
$enc_url = preg_replace_callback(
'%[^:/@?&=#]+%usD',
@@ -653,12 +653,12 @@ public function addUniquePrefixToBasename($filename, $uniqid = null)
}
/**
- * Log to var/log/cloudinary_cloudinary.log
- * @method log
- * @param mixed $message
- * @param array $data
- * @return $this
- */
+ * Log to var/log/cloudinary_cloudinary.log
+ * @method log
+ * @param mixed $message
+ * @param array $data
+ * @return $this
+ */
public function log($message, $data = [], $prefix = '[Cloudinary Log] ')
{
$this->cloudinaryLogger->info($prefix . json_encode($message), $data);
diff --git a/Plugin/Catalog/Block/Product/ImageFactory.php b/Plugin/Catalog/Block/Product/ImageFactory.php
index 9a3b258..866d70a 100644
--- a/Plugin/Catalog/Block/Product/ImageFactory.php
+++ b/Plugin/Catalog/Block/Product/ImageFactory.php
@@ -139,9 +139,10 @@ public function aroundCreate(CatalogImageFactory $catalogImageFactory, callable
}
if ($this->configuration->isEnabledLazyload()) {
+ $useOldImageTheme = is_string($imageBlock->getCustomAttributes()) ? 'old_' : '';
$imageBlock->setTemplate(
\preg_match('/\/image_with_borders.phtml$/', $imageBlock->getTemplate()) ?
- 'Cloudinary_Cloudinary::product/image_with_borders.phtml' : 'Cloudinary_Cloudinary::product/image.phtml'
+ 'Cloudinary_Cloudinary::product/' . $useOldImageTheme . 'image_with_borders.phtml' : 'Cloudinary_Cloudinary::' . $useOldImageTheme . 'product/image.phtml'
);
$imageBlock->setLazyloadPlaceholder(Configuration::LAZYLOAD_DATA_PLACEHOLDER);
}
diff --git a/Plugin/CatalogImportExport/Model/Import/Product/MediaGalleryProcessor.php b/Plugin/CatalogImportExport/Model/Import/Product/MediaGalleryProcessor.php
index fb69dd4..5b1687e 100644
--- a/Plugin/CatalogImportExport/Model/Import/Product/MediaGalleryProcessor.php
+++ b/Plugin/CatalogImportExport/Model/Import/Product/MediaGalleryProcessor.php
@@ -199,7 +199,7 @@ private function processMediaPerStore(
array $mediaGalleryData,
array $newMediaValues,
array $valueToProductId
- ) {
+ ) {
$multiInsertData = [];
$multiInsertDataVideos = [];
$dataForSkinnyTable = [];
diff --git a/Plugin/Ui/Component/Form/Element/DataType/Media.php b/Plugin/Ui/Component/Form/Element/DataType/Media.php
index e627a05..d1de81c 100644
--- a/Plugin/Ui/Component/Form/Element/DataType/Media.php
+++ b/Plugin/Ui/Component/Form/Element/DataType/Media.php
@@ -49,6 +49,8 @@ public function afterPrepare(\Magento\Ui\Component\Form\Element\DataType\Media $
$type = 'design_config_fileUploader';
} elseif (strpos($uploaderConfigUrl, '/category_image/') !== false) {
$type = 'category_image';
+ } elseif (strpos($uploaderConfigUrl, '/pagebuilder/contenttype/') !== false) {
+ $type = 'pagebuilder_contenttype';
} else {
$type = null;
}
diff --git a/composer.json b/composer.json
index 0ef75df..8b7803b 100644
--- a/composer.json
+++ b/composer.json
@@ -2,7 +2,7 @@
"name": "cloudinary/cloudinary-magento2",
"description": "Cloudinary Magento 2 Integration.",
"type": "magento2-module",
- "version": "1.13.0",
+ "version": "1.14.1",
"license": "MIT",
"require": {
"cloudinary/cloudinary_php": "*"
diff --git a/etc/module.xml b/etc/module.xml
index 82b4af4..ae50380 100644
--- a/etc/module.xml
+++ b/etc/module.xml
@@ -1,8 +1,9 @@