static_asset_cache_buster_entity_type_alter() should check if 'image_style' entity type exists

Created on 29 March 2023, over 1 year ago

Problem/Motivation

While writing test coverage, I discovered this bug. static_asset_cache_buster_entity_type_alter() should check if the 'image_style' entity type exists.

Undefined array key "image_style"

/var/www/html/web/modules/contrib/static_asset_cache_buster/static_asset_cache_buster.module:15
/var/www/html/web/core/lib/Drupal/Core/Extension/ModuleHandler.php:545
/var/www/html/web/core/lib/Drupal/Core/Plugin/DefaultPluginManager.php:340
/var/www/html/web/core/lib/Drupal/Core/Entity/EntityTypeManager.php:123
/var/www/html/web/core/lib/Drupal/Core/Plugin/DefaultPluginManager.php:181
/var/www/html/web/core/lib/Drupal/Component/Plugin/Discovery/DiscoveryCachedTrait.php:22
/var/www/html/web/core/lib/Drupal/Core/Entity/EntityTypeManager.php:132
/var/www/html/web/core/tests/Drupal/KernelTests/KernelTestBase.php:757
/var/www/html/web/core/modules/field/tests/src/Kernel/FieldKernelTestBase.php:60
/var/www/html/web/modules/contrib/static_asset_cache_buster/tests/src/Kernel/FileFormatterTest.php:55
/var/www/html/vendor/phpunit/phpunit/src/Framework/TestResult.php:728

Steps to reproduce

  1. Install the module without the image module installed.

Proposed resolution

Check if the array key 'image_style' exists in $entity_types before overriding the class.

Remaining tasks

Need patch.

User interface changes

None.

API changes

None.

Data model changes

None.

πŸ› Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States Chris Burge

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

Comments & Activities

Production build 0.69.0 2024