Problem/Motivation
When updating to 1.1.11 of this module and running `drush updb` to execute database updates, the `acquia_dam_update_9020` hook fails with the following error:
[warning] Undefined array key "image_style" Image.php:110 [error] TypeError: Drupal\acquia_dam\ImageStyleHelper::addAllowedImageStyle(): Argument #1 ($style) must be of type string, null given, called in /web/modules/contrib/acquia_dam/src/Plugin/media/acquia_dam/Image.php on line 116
Proposed resolution
Use the null coalescing operator when accessing potentially undefined array keys, an check that $style_value is not empty before passing to addAllowedImageStyle()
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 3575825-2.patch | 884 bytes | cindytwilliams |
Issue fork acquia_dam-3575825
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
cindytwilliams commentedThis patch fixes the TypeError in Image::setSettings() by:
This allows acquia_dam_update_9020 to complete successfully without errors.
Comment #6
amangrover90 commented