[drupalImage] Image links fail to update when using Full HTML

Created on 13 November 2023, 7 months ago
Updated 17 November 2023, 7 months ago

Problem/Motivation

The behavior of images with a hyperlink is inconsistent between the Basic HTML and Full HTML text formats. When trying to edit the link target of an image in the Full Text editor format, the UI makes it appear as if they link edit is successful, but switching to source view mode shows that the URL remains unchanged, as does saving the page and viewing the result from the front-end.

Steps to reproduce

  • Spin up a new sandbox site at https://simplytest.me/
  • For the project, select Drupal Core and version 10.1.x
  • Create a new basic page
  • In the test basic page in edit mode, make sure the editor is set to full html
  • Add an image to the page content
  • Add a link to the image
  • Switch to the "source" view of the content to confirm the image link URL
  • Switch back to visual editing mode
  • Update the image link URL
  • Switch to the "source" view of the content and see that the URL has not been updated
🐛 Bug report
Status

Active

Version

11.0 🔥

Component
CKEditor 5 

Last updated about 19 hours ago

Created by

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

Comments & Activities

  • Issue created by @sumocannon
  • 🇧🇪Belgium Wim Leers Ghent 🇧🇪🇪🇺

    Could you please convert your manual steps to reproduce (thanks!) into a test instead? 🙏

    \Drupal\Tests\ckeditor5\FunctionalJavascript\ImageTestBase::testLinkability() actually already tests this for both Basic HTML and Full HTML:

      public function providerLinkability(): array {
        return [
          'BLOCK image, restricted' => ['block', FALSE],
          'BLOCK image, unrestricted' => ['block', TRUE],
          'INLINE image, restricted' => ['inline', FALSE],
          'INLINE image, unrestricted' => ['inline', TRUE],
        ];
      }
    

    ("unrestricted" = Full HTML, "restricted" = Basic HTML)

    That is testing with:

        // Fill in link form balloon's <input> and hit "Save".
        $url_input->setValue('http://www.drupal.org/association');
        $balloon->pressButton('Save');
    

    What you're describing is editing a link. The test is currently only adding/removing a link.

Production build 0.69.0 2024