Problem/Motivation
Install v3.0.1 of this module on a fresh Drupal 10.3.6 site with composer and enable it. Follow the provided help:
Enable the text format filter Display responsive images or Display image styles and select the images styles/responsive styles that you want to be available to the user.
Create new content. In the editor, click on the image icon in the toolbar. A popup will open where the user can upload an image then assign an image style or responsive style by selecting style from a dropdown menu.
On step 1, as soon as you visit any of the default text formats' edit pages, you get 3 warnings (last one is repeated twice):
- Warning: Undefined array key "image_styles" in Drupal\inline_responsive_images\Plugin\Filter\FilterImageStyle->settingsForm() (line 115 of modules/contrib/inline_responsive_images/src/Plugin/Filter/FilterImageStyle.php).
- Warning: Undefined array key "image_styles" in Drupal\inline_responsive_images\Plugin\Filter\FilterResponsiveImageStyle->settingsForm() (line 103 of modules/contrib/inline_responsive_images/src/Plugin/Filter/FilterResponsiveImageStyle.php).
- Warning: foreach() argument must be of type array|object, null given in Drupal\Core\Render\Element\Checkboxes::valueCallback() (line 113 of core/lib/Drupal/Core/Render/Element/Checkboxes.php).
Those go away after you actually enable the image style filter, but this represents a problem for the text formats that won't enable the filter (eg. Plain text): they will always display the error to the Admin / Site builder.
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | undefined_key_imagestyle-3485717-6.patch | 1.31 KB | ushma |
Issue fork inline_responsive_images-3485717
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:
- 3485717-warnings-at-the
compare
Comments
Comment #2
kopeboyComment #3
kopeboyComment #4
ushma commentedComment #5
ushma commentedCreated and MR to fix the warnings and attached the patch too. Please review.
Comment #6
ushma commentedComment #7
ushma commentedComment #8
knyshuk.vova commentedTested on Drupal 9.5.11, it applies correctly, works as expected and resolves the issue
+1 RTBC
Comment #10
vladimirausThank you. Committed.
Comment #11
vladimiraus