Commit f627aacd authored by Gaus Surahman's avatar Gaus Surahman Committed by Gaus Surahman
Browse files

Issue #3273663 by gausarts, vistree: Update to version > 2.6 breaks svg_image

parent 0fd8a5b0
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line

Blazy 8.x-2.0-dev, 2022-04-07
-----------------------------
- Issue #3273663 by gausarts, vistree: Update to version > 2.6 breaks svg_image.

Blazy 8.x-2.0-dev, 2022-04-05
-----------------------------
- Fixed for BVEF BC, lightbox gallery regression, etc.
+5 −19
Original line number Diff line number Diff line
@@ -6,7 +6,6 @@ use Drupal\Component\Utility\Html;
use Drupal\Component\Utility\NestedArray;
use Drupal\blazy\Media\BlazyFile;
use Drupal\blazy\Media\BlazyImage;
use Drupal\blazy\Media\BlazyResponsiveImage;
use Drupal\blazy\Media\Placeholder;
use Drupal\blazy\Theme\BlazyAttribute;
use Drupal\blazy\Theme\Grid;
@@ -124,7 +123,7 @@ class Blazy {
    // Checks for lightboxes.
    Check::lightboxes($settings);

    // Checks for [Responsive] image styles.
    // Checks for Image styles, excluding Responsive image.
    BlazyImage::styles($settings);

    // Checks for lazy.
@@ -145,22 +144,6 @@ class Blazy {
    if (!$blazies->was('initialized')) {
      self::preSettings($settings);
    }

    // Checks for [Responsive] image dimensions and sources for formatters
    // and filters. Sets dimensions once, if cropped, to reduce costs with ton
    // of images. This is less expensive than re-defining dimensions per image.
    // These also provide data for the Preload option.
    if (!$blazies->was('dimensions')) {
      if ($blazies->get('first.uri')) {
        if ($blazies->get('resimage.style')) {
          BlazyResponsiveImage::dimensions($settings, TRUE);
        }
        elseif ($style = $blazies->get('image.style')) {
          BlazyImage::cropDimensions($settings, $style);
        }
      }
      $blazies->set('was.dimensions', TRUE);
    }
  }

  /**
@@ -168,10 +151,13 @@ class Blazy {
   */
  public static function prepare(array &$settings, $item = NULL, $delta = -1): void {
    CheckItem::essentials($settings, $item, $delta);

    if ($settings['blazies']->get('image.uri')) {
      CheckItem::multimedia($settings);
    CheckItem::unstyled($settings, $item);
      CheckItem::unstyled($settings);
      CheckItem::insanity($settings);
    }
  }

  /**
   * Blazy is prepared with an URI, provides few attributes as needed.
+2 −2
Original line number Diff line number Diff line
@@ -237,8 +237,8 @@ class BlazyAlter {
        'is_view'     => FALSE,
      ];

      // @todo remove `formatter` key if the above is proven wrong.
      $blazies->set('view.formatter', $current, TRUE);
      // @todo add `formatter` key if the above is proven right.
      $blazies->set('view', $current, TRUE);
    }
  }

+1 −2
Original line number Diff line number Diff line
@@ -252,6 +252,7 @@ class BlazyDefault {
      'box' => [],
      'box_media' => [],
      'image' => [],
      'images' => [],
      'initial' => 0,
      'is' => [],
      'item' => ['delta' => 0],
@@ -261,8 +262,6 @@ class BlazyDefault {
      'media' => [],
      'resimage' => [],
      'ui' => self::uiSettings(),
      'uris' => [],
      'urls' => [],
      'use' => [],
      'switch' => NULL,
      'thumbnail' => [],
+0 −7
Original line number Diff line number Diff line
@@ -5,7 +5,6 @@ namespace Drupal\blazy;
use Drupal\Core\Entity\EntityInterface;
use Drupal\blazy\Field\BlazyField;
use Drupal\blazy\Media\BlazyOEmbedInterface;
use Drupal\blazy\Media\BlazyResponsiveImage;
use Symfony\Component\DependencyInjection\ContainerInterface;

/**
@@ -90,12 +89,6 @@ class BlazyEntity implements BlazyEntityInterface {
    $this->oembed->build($data, $entity);

    $settings = &$data['settings'];
    $blazies = $settings['blazies'];

    // Made Responsive image also available outside formatters here.
    if ($blazies->get('resimage.style')) {
      BlazyResponsiveImage::dimensions($settings, FALSE);
    }

    // Only pass to Blazy for known entities related to File or Media.
    if (in_array($entity->getEntityTypeId(), ['file', 'media'])) {
Loading