This is a much needed module, and is great when it works. I'd like to report a problem I am having in case someone has encountered this.

Whether I choose to use Display Responsive Images, or Display image styles, all the images loaded into CKeditor eventually stop getting rendered in the output markup. Meaning, the images are hidden/gone/goodbye. However, when I select to Edit the page, I can see the image is in fact showing in CKeditor.

CKeditor Two Filter Setting Scenarios:

Try #1) All filters off except Display Image styles

Try #2) Enabled Filters
Linkit filter
Align images
Caption images
Correct faulty and chopped off HTML
Track images uploaded via a Text Editor
Display Image styles (or Display Responsive Images)

I have tested this multiple times over three different test sites. I'll think the problem is solved, then hours later, or the next day, all the images will no longer render on the page.

Thanks for any input...

Comments

Erik Hendrick created an issue. See original summary.

Jon@s’s picture

Having the same/similar issue. Any image where data-responsive-image-style= has a value other than "" the image is not shown (note that the caption, if one exists, is shown).
Not sure if it's related, but when submitting a node where there is an inline responsive image (again only where data-responsive-image-style= has value other than "") it throws several errors in the log, all related to the validate function
function inline_responsive_images_form_editor_image_dialog_responsive_validate(array &$form, FormStateInterface &$form_state) {

Errors:
1. Notice: Undefined index: responsive_image.viewport_sizing in inline_responsive_images_form_editor_image_dialog_responsive_validate() (line 255 of /Users/Jonas/Sites/SurvivalResourcesDrupal/modules/inline_responsive_images/inline_responsive_images.module).

2. Warning: array_keys() expects parameter 1 to be array, null given in inline_responsive_images_form_editor_image_dialog_responsive_validate() (line 255 of /Users/Jonas/Sites/SurvivalResourcesDrupal/modules/inline_responsive_images/inline_responsive_images.module).

3. Notice: Undefined index: responsive_image.viewport_sizing in inline_responsive_images_form_editor_image_dialog_responsive_validate() (line 256 of /Users/Jonas/Sites/SurvivalResourcesDrupal/modules/inline_responsive_images/inline_responsive_images.module).

4. Notice: Undefined variable: image_style_name in inline_responsive_images_form_editor_image_dialog_responsive_validate() (line 282 of /Users/Jonas/Sites/SurvivalResourcesDrupal/modules/inline_responsive_images/inline_responsive_images.module).

5. Warning: array_flip(): Can only flip STRING and INTEGER values! in Drupal\Core\Entity\EntityStorageBase->loadMultiple() (line 227 of /Users/Jonas/Sites/SurvivalResourcesDrupal/core/lib/Drupal/Core/Entity/EntityStorageBase.php).

6. Notice: Undefined variable: transformed_dimensions in inline_responsive_images_form_editor_image_dialog_responsive_validate() (line 287 of /Users/Jonas/Sites/SurvivalResourcesDrupal/modules/inline_responsive_images/inline_responsive_images.module).

7. Notice: Undefined variable: transformed_dimensions in inline_responsive_images_form_editor_image_dialog_responsive_validate() (line 288 of /Users/Jonas/Sites/SurvivalResourcesDrupal/modules/inline_responsive_images/inline_responsive_images.module).

erik’s picture

Experienced the same problem and took me some digging through the module's code to discover this happens when twig debugging is enabled. The debugger generates a lot of extra html comment code, which probably isn't handled correctly in the FilterImageStyle.php file.

To make it work, set debugging to false in: /sites/default/services.yml, don't forget to clear your caches afterwards (drush cache-rebuild) and see if it works (for me it does now, at least for image styles, haven't tested responsive images yet, maybe someone else can?)

Hopefully this can be fixed in the next release..

jzp74’s picture

Also had the same problem and was lucky enough to find Erik's comment. Switching off debugging solved the issue for me. Thanks Erik!

gedvan’s picture

Same problem with responsive images. Switching off twig debug and the images are rendered normally.

Jon@s’s picture

Status: Active » Needs review

This issue is fixed with the patch in #2802013 Images not displayed in template debug mode.

afoster’s picture

Status: Needs review » Closed (duplicate)

As outlined by Jon@s This is a duplicate of https://www.drupal.org/node/2802013