Blazy field formatter does not respect responsive image styles

Created on 9 September 2023, 9 months ago
Updated 12 September 2023, 9 months ago

Problem/Motivation

Hi
I enabled "support responsive image" in Blazy UI. but when I use blazy as a field formatter in views (for a media reference field) it does not have any effects! and that image will be loaded in its original format. it is just the case for responsive image styles and if I choose a simple image style it will be respected. I included the images.

Steps to reproduce

1. enabling "Support Responsive image" in Blazy UI

2. Create a view with "Fields"

3. Add a media reference field with Blazy field formatter

4. in Blazy settings for that field choose your desired responsive image style

5. click save!

6. nothing happens and if you come back to blazy field formatter settings, the responsive image style is empty! (it seems that it does not save)

Proposed resolution

The workaround was to create custom Media Display modes and choose my settings there and choosing a render entity in views (instead of field view). But it is inconvenient.

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Fixed

Version

2.16

Component

Code

Created by

🇮🇷Iran abedih

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @abedih
  • 🇮🇩Indonesia gausarts

    Thank you.

    I am away from laptop till tomorrow.

    • Is it also happening on Content type > Page > Manage display? Or just Views UI?
    • Is it still happening on the latest 2.17-RC? Be sure to also update sub-modules into their latest RCs if using them.
  • Status changed to Fixed 9 months ago
  • 🇮🇩Indonesia gausarts

    I did notice broken Responsive image option in 2.16, only specific in Views UI, yet fine in Field formatter displays.

    Was fixed in 2.17 without me even knowing this issue, likely just oversight somewhere :)

    Updating to 2.7 should fix it. Should be marked outdated but to minimize dup issues for another two weeks till 2.17 out.

    Thanks again.

  • 🇮🇷Iran abedih

    @gausarts

    Thank you. Yes the problem fixed and the latest rc version is much better. BUT when I updated Blazy to latest rc version I get two errors regarding Slick and Splide. I don't know whrere to report those bugs because I don't know this is causes by Blazy or those modules.

  • 🇮🇩Indonesia gausarts

    Just to be clear, you are using their latest RCs and got errors?

    If clearing caches did not help, I must have missed something obvious :)

    Feel free to paste the errors here, or create new issues there.

  • 🇮🇷Iran abedih

    @gausarts

    Yes, I checked both stable versions and latest RCs

    this error is what I get with latest RC Splide and Blazy 2.17-rc4:

    Warning: Undefined array key "settings" in Drupal\splide\Plugin\Field\FieldFormatter\SplideEntityReferenceFormatterBase->buildElement() (line 21 of modules/contrib/splide/src/Plugin/Field/FieldFormatter/SplideVanillaWithNavTrait.php).

    And this is what I get from latest stable Slick and Blazy 2.17-rc4:

    Fatal error: Cannot make non static method Drupal\blazy\Plugin\Filter\TextFilterBase::getValidNode() static in class Drupal\slick\Plugin\Filter\SlickFilter in /app/web/modules/contrib/slick/src/Plugin/Filter/SlickFilter.php on line 498

    I've attached complete splide error log

  • 🇮🇷Iran abedih

    UPDATE:

    it seems I made a mistake in updating both modules. I tried composer require 'drupal/splide:^1.0@RC' but strangely it did not update. I used exact version number and I did updated.

    Now there is no problem and everything works very well. Thank you @gausarts!

  • 🇮🇩Indonesia gausarts

    Yes. That @RC was reported somewhere else and was breaking the updates.

    Removing it should make things fall in place.

    Thanks for confirming and followups :)

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.69.0 2024