Images not rendering using Media Library

Created on 19 June 2024, 6 months ago
Updated 20 June 2024, 6 months ago

Hi Team,

We upgraded our site from Drupal 10.1.5 to 10.2.7.

After the upgrade, the images uploaded using "Media Library" on the "CKEditor" were not rendering on the site.

A reference image is attached.

When we check on the editor, the preview of the image is also not showing. 

The image source is rendered as [src="sites/files/blank.gif"] on the page.

Please help us to fix this issue.

💬 Support request
Status

Closed: outdated

Version

10.2

Component
Image system 

Last updated 1 day ago

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @harikumar_prft
  • What exactly is shown on the "source" view in CKEditor on the node you showed above?

  • On the source it is showing as

     

    But when we save and look on the page, the src attribute on the img tag is "sites/files/blank.gif"

  • "blank.gif" doesn't appear in Drupal Core's source code. Are there additional media or image-related modules installed on the site? Were there any errors or difficulties upgrading? Are any patches installed?

  • There is no patches added related to the media or image.

    Modules

    Media
    Media Library
    Image
    Blazy UI (Latest version)

  • If you export the entire site configuration, does "blank.gif" appear in those files? If so, which file?

  • That is from custom theme twig file.

    themes->custom->theme_name->templates->system->image.html.twig

    {#
    /**
     * @file
     * Theme override of an image.
     *
     * Available variables:
     * - attributes: HTML attributes for the img tag.
     * - style_name: (optional) The name of the image style applied.
     *
     * @see template_preprocess_image()
     */
    #}
    <img{{ attributes }} class="lazyload" src="/sites/files/blank.gif" data-src="{{datasrc}}" />
  • So your lazy load implementation probably broke or is missing. Are there browser console errors?

    You can try deleting that theme file. Lazy load is built in to Drupal image tags now.

  • By deleting the twig file on the theme,  broke the site.

    We updated the twig file, and the issue got fixed.

    Thanks for the prompt response and your help.

  • Status changed to Closed: outdated 6 months ago
Production build 0.71.5 2024