Skip to content

Commit 9f10680

Browse files
authored
Merge pull request #94 from netgen/NGSTACK-672-remove-remoteid-urlencode
NGSTACK-672 Remove urlencode for IDs when fetching remote resource
2 parents 366ed71 + 01d6ed8 commit 9f10680

4 files changed

Lines changed: 5 additions & 10 deletions

File tree

.github/workflows/tests.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,12 @@ jobs:
3434

3535
# Install Flex as a global dependency to enable usage of extra.symfony.require
3636
# while keeping Flex recipes from applying
37+
- run: composer global config --no-plugins allow-plugins.symfony/flex true
3738
- run: composer global require --no-scripts symfony/flex
3839

40+
# Install eZ Publish legacy installer as a global dependency
41+
- run: composer config --no-plugins allow-plugins.ezsystems/ezpublish-legacy-installer true
42+
3943
- run: composer config extra.symfony.require ${{ matrix.symfony }}
4044

4145
-

bundle/Converter/XmlText/NgRemoteMediaPreConverter.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
use DOMXPath;
99
use eZ\Publish\Core\FieldType\XmlText\Converter;
1010
use Netgen\Bundle\RemoteMediaBundle\RemoteMedia\RemoteMediaProvider;
11-
use function basename;
1211
use function json_decode;
1312

1413
class NgRemoteMediaPreConverter implements Converter

bundle/RemoteMedia/Provider/Cloudinary/CloudinaryProvider.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,8 +286,7 @@ public function getVideoThumbnail(Value $value, $options = []): string
286286
{
287287
if (array_key_exists('content_type_identifier', $options) && array_key_exists('variation_name', $options)) {
288288
$options['transformation'] = $this->processConfiguredVariation($value, $options['variation_name'], $options['content_type_identifier']);
289-
unset($options['content_type_identifier']);
290-
unset($options['variation_name']);
289+
unset($options['content_type_identifier'], $options['variation_name']);
291290
}
292291

293292
if (count($options) === 0 || !array_key_exists('resource_type', $options)) {

bundle/RemoteMedia/Provider/Cloudinary/Gateway/CloudinaryApiGateway.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
use function min;
2929
use function round;
3030
use function sprintf;
31-
use function urlencode;
3231

3332
class CloudinaryApiGateway extends Gateway
3433
{
@@ -264,12 +263,6 @@ public function countResourcesInFolder($folder)
264263
public function get($id, $type)
265264
{
266265
try {
267-
$id = array_map(function (string $part) {
268-
return urlencode($part);
269-
}, explode('/', $id));
270-
271-
$id = implode('/', $id);
272-
273266
return (array) $this->cloudinaryApi->resource($id, ['resource_type' => $type]);
274267
} catch (Cloudinary\Error $e) {
275268
return [];

0 commit comments

Comments
 (0)