Image & width not reflecting on frontend when resize the media image on second or more times

Created on 26 July 2023, 11 months ago
Updated 16 August 2023, 11 months ago

Problem/Motivation

Steps to reproduce

Add media image using media library, resize the media image and save, the changes will reflect on front end.
Visit the same page and again resize the media image, the changes will not reflect on the front end.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇮🇳India userguest123

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

Comments & Activities

  • Issue created by @userguest123
  • I tried to replicate this, but it's working for me in Chrome. Can you please record a screencast and provide further details like browser and OS you're using @userguest123 ?

  • 🇮🇳India userguest123

    I tried on chrome. If trying to resize again for second time then the height , width is not updating.
    Sharing the recording.

  • Status changed to Postponed: needs info 11 months ago
  • Thank you userguest123. In your screencast, I can see that for some reason the style attribute on your image wrapper is not updating after you re-saved the media and also the width definition in the style attribute seems to be duplicating.

    Could you please provide another screencast showing the entire process from the beginning? I mean from the moment you create the article and embed the image the first time.

    Also can you post the Drupal core version you are using please?

  • 🇮🇳India Santhoshkumar

    Hi,

    Please find the attached screencast with more descriptive steps to reproduce the steps. You can find the issue we discussing (the resize width not save from second time onwards) after 1st minute of the video as it describes the width is not getting saved. Please run the video.

  • @s_leu opened merge request.
    • s_leu committed 6bc519ba on 1.0.x
      Issue #3376990 by s_leu, userguest123, Santhoshkumar: Image...
  • Status changed to Fixed 11 months ago
  • Thanks for the screencast @Santhoshkumar. The problem here is two fold:

    1. The style attribute is duplicated when re-saving. This is solved in the commit I just pushed to 1.0.x
    2. The module's functionality is only working if the Limit allowed HTML tags and correct faulty HTML is active. That's why it didn't work as described. So for now the solution for this is that you will have to enable that filter, or otherwise the resizing after saving won't work.

    Regarding 2., I believe this is somehow related to the allowHtml ckeditor5 config passed into the editor when instantiating it. This config is different if the Limit allowed HTML tags and correct faulty HTML is active or if it's not. I'm not 100% sure this is the cause as I didn't get to the bottom of this. Anyway, for now you'll have to live with the fact that the re-resizing after saving isn't working without that filter. Feel free to file a patch/MR to make this work.

    Marking this as fixed as making it work without the mentioned filter is more of a feature request and not a major blocker for the functionality of this module.

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

Production build 0.69.0 2024