Skip to content

Commit

Permalink
Merge pull request #37 from cloudinary/v1.9.7
Browse files Browse the repository at this point in the history
v1.9.7
  • Loading branch information
Pniel (Pini) Cohen authored Aug 4, 2019
2 parents 484fde9 + 5bb77ba commit afcde86
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 13 deletions.
8 changes: 4 additions & 4 deletions Controller/Adminhtml/Ajax/Free/Sample.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

namespace Cloudinary\Cloudinary\Controller\Adminhtml\Ajax\Free;

use Cloudinary\Cloudinary\Core\Image\Transformation\Freeform;
use Cloudinary\Cloudinary\Core\ConfigurationInterface;
use Cloudinary\Cloudinary\Core\Image\Transformation;
use Cloudinary\Cloudinary\Core\Image\Transformation\Freeform;
use Cloudinary\Cloudinary\Model\Config\Backend\Free as FreeBackendModel;
use Magento\Backend\App\Action;
use Magento\Backend\App\Action\Context;
use Magento\Framework\Controller\Result\JsonFactory;
use Cloudinary\Cloudinary\Model\Config\Backend\Free as FreeBackendModel;
use Cloudinary\Cloudinary\Core\ConfigurationInterface;

class Sample extends Action
{
Expand Down Expand Up @@ -76,7 +76,7 @@ public function execute()
private function defaultTransformWithFreeTransform($freeTransform)
{
return $this->configuration->getDefaultTransformation()
->withFreeform(Freeform::fromString($freeTransform));
->withFreeform(Freeform::fromString($freeTransform), false);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion Model/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ public function getCdnSubdomainStatus()
*/
public function getUserPlatform()
{
return sprintf(self::USER_PLATFORM_TEMPLATE, '1.9.6', '2.0.0');
return sprintf(self::USER_PLATFORM_TEMPLATE, '1.9.7', '2.0.0');
}

/**
Expand Down
9 changes: 8 additions & 1 deletion Plugin/Catalog/Block/Product/View/Gallery.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,14 @@ protected function getCloudinaryPGOptions($refresh = false, $ignoreDisabled = fa
break;
case 'video':
if (strpos($value['videoUrl'], '.cloudinary.com/') !== false && strpos($value['videoUrl'], '/' . $this->productGalleryHelper->getCloudName() . '/') !== false) {
$publicId = @pathinfo($value['videoUrl'], PATHINFO_FILENAME) ?: null;
$publicId = $value['videoUrl'];
$publicId = preg_replace('/^.*\/' . $this->productGalleryHelper->getCloudName() . '\/video\/(upload\/)?/', '', $publicId);
$publicId = preg_replace('/\.[^.]+$/', '', $publicId);
$publicId = (array) preg_split('/\/v[0-9]{1,10}\//', $publicId);
if (count($publicId) > 1) {
$transformation = array_shift($publicId);
}
$publicId = implode('', $publicId);
}
break;
}
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "cloudinary/cloudinary-magento2",
"description": "Cloudinary Magento 2 Integration.",
"type": "magento2-module",
"version": "1.9.6",
"version": "1.9.7",
"license": "MIT",
"require": {
"cloudinary/cloudinary_php": "*"
Expand Down
7 changes: 4 additions & 3 deletions etc/adminhtml/system.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,18 @@
<field id="cloudinary_environment_variable" translate="label comment" type="obscure" sortOrder="1" showInDefault="1" showInWebsite="0" showInStore="0" canRestore="1">
<label>Cloudinary Account Credentials</label>
<comment>
<![CDATA[Set the credentials of your Cloudinary account. Copy the "Environment variable" string from the dashboard of Cloudinary's Management Console.<br>Format should be: cloudinary://API_Key:API_Secret@Cloud_Name<input name="disable_autofill_envvar" type="text" style="display:none!important;"><input name="disable_autofill_loginuser" type="password" style="display:none!important;">]]>
<![CDATA[Set the credentials of your Cloudinary account. Copy the "Environment variable" string from the dashboard of Cloudinary's Management Console.<br>Format should be: cloudinary://API_Key:API_Secret@Cloud_Name]]>
</comment>
<backend_model>Cloudinary\Cloudinary\Model\Config\Backend\Credentials</backend_model>
</field>
<field id="cloudinary_automatic_login_user" translate="label" type="text" sortOrder="2" showInDefault="1" showInWebsite="0" showInStore="0" canRestore="1">
<label>Automatic login</label>
<comment><![CDATA[Enter the email address of the user to be automatically logged in to the Media Library. Leave blank to prompt each user to login when the Media Library opens.]]></comment>
<comment><![CDATA[Enter the email address of the user to be automatically logged in to the Media Library. Leave blank to prompt each user to login when the Media Library opens.<input name="disable_autofill_envvar" type="text" value="******" style="display:none!important;"><input name="disable_autofill_loginuser" type="password" value="******" style="display:none!important;">]]></comment>
<validate>validate-email</validate>
</field>
</group>
<group id="configuration" translate="label" sortOrder="3" showInDefault="1" showInWebsite="0" showInStore="0">
<label>Cloudinary Configuration</label>
<label>Cloudinary Account Credentials</label>
<attribute type="expanded">1</attribute>
<field id="cloudinary_cdn_subdomain" translate="label comment" type="select" sortOrder="2" showInDefault="1" showInWebsite="0" showInStore="0" canRestore="1">
<label>Image Delivery Domain Sharding</label>
Expand Down
2 changes: 1 addition & 1 deletion etc/module.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Cloudinary_Cloudinary" setup_version="1.9.6">
<module name="Cloudinary_Cloudinary" setup_version="1.9.7">
<sequence>
<module name="Magento_ProductVideo"/>
</sequence>
Expand Down
2 changes: 1 addition & 1 deletion marketplace.composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "cloudinary/cloudinary",
"type": "magento2-module",
"version": "1.9.6",
"version": "1.9.7",
"description": "Cloudinary Magento 2 Integration.",
"license": "MIT",
"require": {
Expand Down
2 changes: 1 addition & 1 deletion view/adminhtml/web/js/get-video-information.js
Original file line number Diff line number Diff line change
Expand Up @@ -829,7 +829,7 @@ define(
}
} else if (href.host.match(/cloudinary\.com/)) {
type = 'cloudinary';
id = this._baseName(href.href);
id = href.href.replace(new RegExp('^.*\/video\/(upload\/)?((.*\/)?v[0-9]{1,10}\/)?'), '').replace(new RegExp('\.[^.]+$'), '');
}

if ((!id || !type) && forceVideo) {
Expand Down

0 comments on commit afcde86

Please sign in to comment.