In Drupal 8, the inline images are not displayed when template debugging is enabled. because debugging mode outputs additional information in HTML comments.
In FilterImageStyle.php, only the first node of the rendered image is inserted in the output. By inserting all nodes, the debugging problem is solved and coincidentally, the plugin also works with templates in which multiple nodes are used. I propose the attached patch to solve this problem.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ttemiel created an issue. See original summary.

erik’s picture

This is great Emiel, thanks a lot for this patch!
Hope it will be incorporated soon..

Jon@s’s picture

Status: Active » Needs review

Can confirm this patch worked for me with 8.x-2.0 (June 06 2016) and Drupal 8.2.1
Note: I had to apply the patch by hand (no big deal only a few lines) for some reason.

afoster’s picture

Status: Needs review » Reviewed & tested by the community

Confirming the patch resolved the issue with Twig Debugging. Updating status to reviewed (Hopefully this is OK?)

Patch applied to the newest Inline Responsive images 2.x-dev (Oct 20, 2016) in a site running Drupal 8.2.1

Also to note I've running patch from https://www.drupal.org/node/2816745 which allows the UI to work in D8.2.1 - Both patches play nicely together.

profak’s picture

+1 for patch in this issue. @jeroen_betawerk, please commit to 2.x-dev!

keithm’s picture

FileSize
3.53 KB

Rerolled patch to apply cleanly with 'git apply'. The problem Jon@s had in #3 may have been caused by a mixture of line Unix and DOS/Windows endings in the patch, as well as a mixture of line endings in this module itself.

This patch requires the patch from #2865861: Use Unix line endings in code (which corrects the code to use the Drupal standard Unix endings) to be applied first.

  • keithm committed 4a942ca on 8.x-2.x
    Issue #2802013 by emielbeinema, keithm: Fixed images not displayed in...
keithm’s picture

Status: Reviewed & tested by the community » Fixed

This is fixed.

@emielbeinema thanks for investigating and patching.

Status: Fixed » Closed (fixed)

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