Skip to content

Commit 0114124

Browse files
2 parents 8eae893 + 4ce6d50 commit 0114124

File tree

5 files changed

+12
-7
lines changed

5 files changed

+12
-7
lines changed

Helper/ProductGalleryHelper.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ public function getCloudinaryPGOptions($refresh = false, $ignoreDisabled = false
7373
$transformation = [];
7474
$videoSettings = $this->configuration->getAllVideoSettings();
7575
$videoFreeParams = $videoSettings['video_free_params'] ?? null;
76+
$videoControls = $videoSettings['controls'] ?? null;
7677
if ($videoFreeParams) {
7778
$config = json_decode($videoFreeParams, true);
7879
$config = array_shift($config);
@@ -86,13 +87,13 @@ public function getCloudinaryPGOptions($refresh = false, $ignoreDisabled = false
8687
if (!$videoFreeParams || $videoFreeParams == "{}") {
8788
$config = [
8889
'playerType' => 'cloudinary',
89-
'controls' => $videoSettings['controls'],
90+
'controls' => $videoControls,
9091
'chapters' => false,
9192
'muted' => false
9293

9394
];
9495
$autoplayMode = $videoSettings['autoplay'] ?? null;
95-
$config['autoplayMode'] = $videoSettings['autoplay'];
96+
$config['autoplayMode'] = $autoplayMode;
9697
if ($autoplayMode && $autoplayMode != 'never') {
9798
$config['autoplay'] = true;
9899

Plugin/Catalog/Block/Product/View/Gallery.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,11 @@ public function beforeToHtml(\Magento\Catalog\Block\Product\View\Gallery $produc
7878
$productGalleryBlock->setCldPGid($this->getCldPGid());
7979
}
8080
}
81-
81+
public function getCname()
82+
{
83+
$config = $this->configuration->getCredentials();
84+
return ($config['cname']) ?? '';
85+
}
8286
public function getHtmlId()
8387
{
8488
if (!$this->htmlId) {
@@ -167,7 +171,7 @@ protected function getCloudinaryPGOptions($refresh = false, $ignoreDisabled = fa
167171
} elseif ($value['type'] === 'video') {
168172
$url = $value['videoUrl'];
169173
}
170-
if (\strpos($url, '.cloudinary.com/') !== false && (strpos($url, '/' . $this->productGalleryHelper->getCloudName() . '/') !== false || strpos($url, '://' . $this->productGalleryHelper->getCloudName()) !== false)) {
174+
if ((strpos($url, '.cloudinary.com/') !== false) && (strpos($url, '/' . $this->productGalleryHelper->getCloudName() . '/') !== false || strpos($url, '://' . $this->productGalleryHelper->getCloudName()) !== false) || strpos($url, $this->getCname()) !== false) {
171175
$parsed = $this->configuration->parseCloudinaryUrl($url);
172176
$publicId = ($value['type'] === 'image') ? $parsed['publicId'] . '.' . $parsed['extension'] : $parsed['publicId'];
173177
$transformation = \str_replace('/', ',', $parsed['transformations_string']);

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "cloudinary/cloudinary-magento2",
33
"description": "Cloudinary Magento 2 Integration.",
44
"type": "magento2-module",
5-
"version": "1.20.0",
5+
"version": "1.20.1",
66
"license": "MIT",
77
"require": {
88
"cloudinary/cloudinary_php": ">=2.7 <=2.11.0"

etc/adminhtml/system.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
<field id="cloudinary_environment_variable" translate="label comment" type="obscure" sortOrder="1" showInDefault="1" showInWebsite="0" showInStore="0" canRestore="1">
2828
<label>Cloudinary Account Credentials</label>
2929
<comment>
30-
<![CDATA[Set your Cloudinary account credentials. Copy the "Environment variable" string from the dashboard of <a href="https://cloudinary.com/console" target="_blank" title="Cloudinary's Management Console">Cloudinary's Management Console</a>.<br>Format should be: cloudinary://API_Key:API_Secret@Cloud_Name]]>
30+
<![CDATA[Copy the <b>API environment variable</b> format from the <a href="https://console.cloudinary.com/settings/api-keys" target="_blank">API Keys</a> page. Replace [your_api_key] and [your_api_secret] with your actual values, while your cloud name is already correctly included in the format.]]>
3131
</comment>
3232
<backend_model>Cloudinary\Cloudinary\Model\Config\Backend\Credentials</backend_model>
3333
</field>

etc/module.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0"?>
22
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
3-
<module name="Cloudinary_Cloudinary" setup_version="1.20.0">
3+
<module name="Cloudinary_Cloudinary" setup_version="1.20.1">
44
<sequence>
55
<module name="Magento_ProductVideo"/>
66
<module name="Magento_PageBuilder"/>

0 commit comments

Comments
 (0)