Commit 20164918 authored by Kristof De Jaeger's avatar Kristof De Jaeger
Browse files

Issue #3297417: hello D10

parent d9c00627
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -3,5 +3,5 @@ name: Imagecache External
description: Allows you to fetch external images and use image styles on them.
dependencies:
  - drupal:image
core_version_requirement: ^8 || ^9
core_version_requirement: ^9.3 || ^10
configure: imagecache_external.admin_settings
+1 −1
Original line number Diff line number Diff line
@@ -216,7 +216,7 @@ function imagecache_external_fetch($url, $cachepath) {
        return \Drupal::service('file_system')->saveData($result->getBody(), $cachepath, FileSystemInterface::EXISTS_REPLACE);
      }
      else {
        $file = file_save_data($result->getBody(), $cachepath, FileSystemInterface::EXISTS_REPLACE);
        $file = \Drupal::service('file.repository')->writeData($result->getBody(), $cachepath, FileSystemInterface::EXISTS_REPLACE);
        return $file->getFileUri();
      }
    }
+1 −1
Original line number Diff line number Diff line
@@ -98,7 +98,7 @@ class SettingsForm extends ConfigFormBase {
      '#title' => $this->t('How should Drupal handle the files?'),
      '#description' => $this->t('Managed files can be re-used elsewhere on the site, for instance in the Media Library if you use the Media module. Unmanaged files are not saved to the database, but can be cached using Image Styles.'),
      '#options' => [
        'unmanaged' => $this->t('Unmanaged: Only save the images to the files folder to be able to cache them. This is  default.'),
        'unmanaged' => $this->t('Unmanaged: Only save the images to the files folder to be able to cache them.'),
        'managed' => $this->t('Managed: Download the images and save its metadata to the database.'),
      ],
      '#default_value' => $config->get('imagecache_external_management'),
+2 −2
Original line number Diff line number Diff line
@@ -192,7 +192,7 @@ class ImagecacheExternalImage extends FormatterBase implements ContainerFactoryP
      }

      if (isset($link_file)) {
        $url = Url::fromUri(file_create_url($image_path));
        $url = \Drupal::service('file_url_generator')->generate($image_path);
      }

      $image = $this->imageFactory->get($image_path);
@@ -219,7 +219,7 @@ class ImagecacheExternalImage extends FormatterBase implements ContainerFactoryP
      }

      if ($url) {
        $rendered_image = render($image_build);
        $rendered_image = \Drupal::service('renderer')->render($image_build);
        $elements[$delta] = Link::fromTextAndUrl($rendered_image, $url)->toRenderable();
      }
      else {
+2 −2
Original line number Diff line number Diff line
@@ -250,7 +250,7 @@ class ImagecacheExternalResponsiveImage extends FormatterBase implements Contain
      }

      if (isset($link_file)) {
        $url = Url::fromUri(file_create_url($image_path));
        $url = \Drupal::service('file_url_generator')->generate($image_path);
      }

      $image = $this->imageFactory->get($image_path);
@@ -277,7 +277,7 @@ class ImagecacheExternalResponsiveImage extends FormatterBase implements Contain
      }

      if ($url) {
        $rendered_image = render($image_build);
        $rendered_image = \Drupal::service('renderer')->render($image_build);
        $elements[$delta] = Link::fromTextAndUrl($rendered_image, $url)->toRenderable();
      }
      else {