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):

  1. 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).
  2. 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).
  3. 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.

CommentFileSizeAuthor
#6 undefined_key_imagestyle-3485717-6.patch1.31 KBushma
Command icon 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

kopeboy created an issue. See original summary.

kopeboy’s picture

Title: 3 warning at the text format edit page before configuration » Warnings at the text format edit page when filter is disabled
kopeboy’s picture

Issue summary: View changes
ushma’s picture

Assigned: Unassigned » ushma
ushma’s picture

Assigned: ushma » Unassigned

Created and MR to fix the warnings and attached the patch too. Please review.

ushma’s picture

StatusFileSize
new1.31 KB
ushma’s picture

Status: Active » Needs review
knyshuk.vova’s picture

Status: Needs review » Reviewed & tested by the community

Tested on Drupal 9.5.11, it applies correctly, works as expected and resolves the issue
+1 RTBC

vladimiraus changed the visibility of the branch 3485717-warnings-at-the to hidden.

vladimiraus’s picture

Version: 3.0.1 » 3.0.x-dev

Thank you. Committed.

vladimiraus’s picture

Status: Reviewed & tested by the community » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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