D10 issues with image styles?

Created on 17 July 2023, 12 months ago
Updated 19 July 2023, 12 months ago

Problem/Motivation

I've set this up on a fresh D10 site with the Bootstrap Barrio theme's breakpoints, and I've configured the preprocess function in my subtheme. I'm getting this error:

Warning: array_flip(): Can only flip string and integer values, entry skipped in Drupal\Core\Entity\EntityStorageBase->loadMultiple() (line 278 of /var/www/html/web/core/lib/Drupal/Core/Entity/EntityStorageBase.php)

#0 /var/www/html/web/core/includes/bootstrap.inc(164): _drupal_error_handler_real(2, 'array_flip(): C...', '/var/www/html/w...', 278)
#1 [internal function]: _drupal_error_handler(2, 'array_flip(): C...', '/var/www/html/w...', 278)
#2 /var/www/html/web/core/lib/Drupal/Core/Entity/EntityStorageBase.php(278): array_flip(Array)
#3 /var/www/html/web/core/lib/Drupal/Core/Entity/EntityStorageBase.php(262): Drupal\Core\Entity\EntityStorageBase->loadMultiple(Array)
#4 /var/www/html/web/core/lib/Drupal/Core/Entity/EntityBase.php(488): Drupal\Core\Entity\EntityStorageBase->load(Array)
#5 /var/www/html/web/modules/contrib/responsive_background_image/src/ResponsiveBackgroundImage.php(170): Drupal\Core\Entity\EntityBase::load(Array)
#6 /var/www/html/web/themes/custom/gocorps2023/gocorps2023.theme(80): Drupal\responsive_background_image\ResponsiveBackgroundImage::generateMediaQueries('.paragraph--id-...', Object(Drupal\paragraphs\Entity\Paragraph), 'field_backgroun...', 'wide')
...

Steps to reproduce

Follow the docs on a stock D10 install with the Bootstrap Barrio theme.

Proposed resolution

Not sure the issue is with Barrio - maybe something in the way the image styles are loaded in D10? This is the offending line:

        default:
          $image_path = \Drupal::service('file_url_generator')->transformRelative(ImageStyle::load($image_style)->buildUrl($uri));
          break;
      }

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Active

Version

2.0

Component

Code

Created by

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

Comments & Activities

Production build 0.69.0 2024