Drupal 10 & CKEditor 5 readiness

Created on 31 March 2022, over 2 years ago
Updated 29 August 2024, 3 months ago

Problem/Motivation

We are planning to integrate Ckeditor5 with Drupal 9. Looking for Embedding Entity through the CkEditor 5. Is there any way to add Entity Embed Option in CKEditor 5?

Are you planning to include this Entity Embed module in CKEditor 5?

Thanks in Advance
Venkat

Steps to reproduce

Upgrade a text format using entity embed to ckeditor 5.

Proposed resolution

Implement CKEditor5 Plugin

Remaining tasks

  1. Fix bugs surfaced by the functional JS test failures in #104.

Known Issues

- Button Icons may not work if they where using PNG and will need to be manually converted to SVG. 📌 When CKEditor5 is installed, only allow SVGs for button icons Fixed

User interface changes

n/a

API changes

N/A New plugin

Data model changes

n/a

Release notes snippet

TBD

Feature request
Status

Fixed

Version

1.0

Component

CKEditor integration

Created by

Live updates comments and jobs are added and updated live.
  • JavaScript

    Affects the content, performance, or handling of Javascript.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇺🇸United States trigdog

    @alphex, are you sure you have the checkbox checked to "Display embedded entities" on your text format (Full HTML for example) you enabled the entity embed button on?

  • 🇦🇺Australia yovince Melbourne

    hey @alphex,
    please check a couple of things below,
    1. have you put `Embed media`filter directly after `Align images` and `Caption images` ?
    2. have you enabled `Display embedded entities` filter and put it after `Embed media` filter
    3. uncheck `Limit allowed HTML tags and correct faulty HTML` if you are not sure which HTML tags need to allow.

  • First commit to issue fork.
  • 🇮🇩Indonesia el7cosmos 🇮🇩 GMT+7

    Also experiencing the same issue with @alphex, this is because of missing allowed attributes in the <drupal-entity> element.

    Pushed fix to MR

  • 🇮🇩Indonesia el7cosmos 🇮🇩 GMT+7

    I've added a toolbar balloon for edit functionality that brings up a modal dialog. I duplicate core's openDialog function as now it's missing existingValues param as in 🐛 Drupal.ckeditor5.openDialog missing existingValues param Needs work

    I personally think we can use something like Image contextual toolbar for display, alt, align, and caption.

  • 🇮🇩Indonesia el7cosmos 🇮🇩 GMT+7
  • 🇺🇸United States drupgirl

    Thank you for moving this forward. I, too, need to embed nodes and upgrade to ckeditor5. The patch does not apply to version 8.x-1.3. Is it possible for someone to work on this? Thank you for all your work!

  • 🇦🇺Australia yovince Melbourne

    Thanks for the patch!

    But I am getting

    Uncaught EvalError: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src 'self' 'unsafe-inline' svc.webspellchecker.net cdn.jsdelivr.net".
    
        at ./js/ckeditor5_plugins/drupalentity/src/index.js (<anonymous>:1:14050)
    

    error, and the CKEDITOR5 can't be rendered.
    The fix for me is `cd` to the `entity_embed` module , run `npm run build` to regenerate the index.js

  • 🇮🇳India guptahemant

    Attaching the latest code from MR in patch format for testing and usage in one of my projects.

  • 🇮🇳India guptahemant

    While testing the patch i observed following error on basic html format:
    `CKEditorError: plugincollection-soft-required {"missingPlugin":"WidgetToolbarRepository","requiredBy":"EntityEmbedToolbar"}`

    On some debugging i observed that this error gets resolved if either table or image widget is enabled.

  • 🇨🇦Canada dylan donkersgoed London, Ontario

    The current MR/patch doesn't apply properly to me due to conflicts between the .info.yml changes and autogenerated changes from Drupal's packages. Here's a patch that can be applied via composer. The changes should not be brought into the MR.

  • 🇮🇩Indonesia el7cosmos 🇮🇩 GMT+7

    I also notice that alignment is not displayed correctly in the editor. Alignment is applied on the image, but not the widget, so the widget will still taking full width in the editor.

  • 🇺🇸United States smustgrave

    Just tested 📌 Migrate to CKEditor 5 for Drupal 9.4+ / Drupal 10 Fixed for paragraphs embed with the MR from 📌 Add CKEditor 5 compatibility and keep supporting CKEditor 4 RTBC and MR 12 from here and thinks appeared to be working for me.

  • Status changed to Needs review over 1 year ago
  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 7.3 & MySQL 5.7
    last update over 1 year ago
    Patch Failed to Apply
  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 7.3 & MySQL 5.7
    last update over 1 year ago
    98 pass
  • 🇺🇸United States neclimdul Houston, TX

    Yeah its working for us too. Moving to NR but this might be RTBC pending the Embed module fix.

  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.5 + Environment: PHP 8.0 & MySQL 5.7
    last update over 1 year ago
    98 pass
  • 🇺🇸United States nomisgnos

    Confirmed, this is working for me. I used the issue fork from Embed Module with this issue's fork.

  • This fork is working for me as long as it's paired with the Embed Module fork listed in this issue here 📌 Add CKEditor 5 compatibility and keep supporting CKEditor 4 RTBC (Just like in #68). It successfully solved an issue with a custom embed for the ckeditor 5 interface we were having. Wonderful work here folks.

  • 🇦🇺Australia fenstrat Australia

    Also confirming after initial testing the MR here is working well.

    A remaining task is listed as adding a CKEditor4To5Upgrade Plugin, but I'm thinking there'll be a bit to that as each site will have a customised list of cke4_buttons that need converting? The plugin would need to load each embed.button and add them as cke4_buttons to be converted.

  • 🇧🇪Belgium BramDriesen Belgium 🇧🇪

    We could theoretically apply the patch on the embed module via the composer file in the module here :-) but not sure if we want to go that route. Depending on how fast the for that is merged we could pin the min version requirements to the version that contains the fix for embed.

  • 🇦🇺Australia fenstrat Australia

    I'd missed the fact that embedded entities cannot be linked. This was possible in CKE4 thanks to Image entities/fields embedded using Entity Embed cannot be linked in CKEditor Fixed which we'd used to allow linkit links for embedded entities.

    Unfortunately this is block upstream in CKEditor 5 itself. This is being tracked. 🐛 [upstream] [GHS] CKEditor 5 removes s that wrap HTML elements not natively supported by CKEditor 5 Fixed and is listed as issue 4. in the tracking issue 🌱 [meta] [upstream] Prioritized CKEditor 5 upstream blockers Active .

  • 🇦🇺Australia fenstrat Australia
  • 🇺🇸United States neclimdul Houston, TX

    Linking embed never worked for me in ckeditor 4 actually. 🐛 Wrapping drupal-media image in a link produces empty P tags after image Needs work 🐛 Adding links around embedded media through CKEditor might lead to invalid/complex markup when rendered Active 🐛 Linking an image creates an empty paragraph tag in CKEditor Needs review so I don't think that's a blocker for this fix.

    Also you might be able to work around it by wrapping it in a div? I'm pretty sure we tested linking embed content and it worked but our content might have different wrappers.

  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 7.3 & MySQL 5.7
    last update over 1 year ago
    98 pass
  • This is the patch I used, in case anyone else wants to try out this issue but can't get the MR patch to apply

  • 🇧🇪Belgium BramDriesen Belgium 🇧🇪

    The merge request only applies to the dev release I noticed when I was testing this out.

    I did notice broken CSS today when using entity embed with Acquia Site Studio (cohesion) on the embed dialog where you select the embed type. Still need to check what's happening there and where the issue lays exactly.

  • 🇺🇸United States pmagunia Philadelphia 🇺🇸

    I think the icons may need to be converted to SVG too.

  • @fenstrat I've started looking into adding a CKEditor4To5Upgrade Plugin, and run into some issues. I was wondering if anyone else was looking into it, or if there was anyone more experienced with plugins than I am, who can answer some questions for me:

    • Is there a way to add values to annotation dynamically? I don't know of one, but the upgrade plugin needs an array of all the names of CKE4 buttons it deals with. Since users create buttons, it can't be hard coded.
    • Are any configuration changes needed? I didn't think so from a quick look at the merge request. If there are no config changes between the CKE4 and 5 buttons, things easy on that front
  • 🇨🇭Switzerland znerol

    Are any configuration changes needed? I didn't think so from a quick look at the merge request. If there are no config changes between the CKE4 and 5 buttons, things easy on that front

    The buttons are handled by the Embed module. I started to write test coverage for 📌 Add CKEditor 5 compatibility and keep supporting CKEditor 4 RTBC and it looks like the button configuration itself is completely unaware of the editor.

  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 7.3 & MySQL 5.7
    last update over 1 year ago
    98 pass
  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 7.3 & MySQL 5.7
    last update over 1 year ago
    98 pass
  • I have added the CKEditor4To5Upgrade Plugin.

    The annotation issue was overcome but using the hook hook_ckeditor4to5upgrade_plugin_info_alter, which allows you to change the array of available CKE 4 to 5 plugins after it has checked the annotations.

    This version of the plugin assumes no configuration changes are needed and that the button IDs don't need to change.

    To test this, select a text editor format and switch it from using CKE4 to 5. Make sure there are no warnings displayed on the page or errors in the log. You should not need to save the changes to the format to see these.

    I have included it as a patch too.

  • 🇺🇸United States pbone3b New York, NY

    Subscribing

  • 🇧🇪Belgium BramDriesen Belgium 🇧🇪

    @pbone3b FYI: No need to create noise in the issue queue by placing a comment. You can simply click on the star/follow on the right under the issue meta info on the top of the issue. 😇

  • I have a ckeditor5 button created using the Embed module ("Embed type" = Views with "Filter which Views to be allowed as options" checked).
    When I click on the icon in the editor toolbar, I get this ajax error:

    The website encountered an unexpected error. Please try again later.

    Drupal\Component\Plugin\Exception\PluginNotFoundException: The "" entity type does not exist. in Drupal\Core\Entity\EntityTypeManager->getDefinition() (line 139 of core/lib/Drupal/Core/Entity/EntityTypeManager.php).
    Drupal\Core\Entity\EntityTypeManager->getHandler() (Line: 192)
    Drupal\Core\Entity\EntityTypeManager->getStorage() (Line: 147)
    Drupal\entity_embed\Form\EntityEmbedDialog->loadEntityByAttributes() (Line: 194)
    Drupal\entity_embed\Form\EntityEmbedDialog->buildForm()
    call_user_func_array() (Line: 534)
    Drupal\Core\Form\FormBuilder->retrieveForm() (Line: 281)
    Drupal\Core\Form\FormBuilder->buildForm() (Line: 73)
    Drupal\Core\Controller\FormController->getContentResult()
    call_user_func_array() (Line: 123)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 580)
    Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 124)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() (Line: 97)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 169)
    Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 81)
    Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 58)
    Drupal\Core\StackMiddleware\Session->handle() (Line: 48)
    Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 270)
    Drupal\shield\ShieldMiddleware->bypass() (Line: 137)
    Drupal\shield\ShieldMiddleware->handle() (Line: 48)
    Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51)
    Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 49)
    Drupal\remove_http_headers\StackMiddleware\RemoveHttpHeadersMiddleware->handle() (Line: 23)
    Stack\StackedHttpKernel->handle() (Line: 718)
    Drupal\Core\DrupalKernel->handle() (Line: 19)

    Drupal version : 9.5.5
    PHP version : 8.0.21

  • 🇦🇺Australia fenstrat Australia

    @RedNeko thanks for your work on the CKEditor4To5Upgrade Plugin! Confirming the hook_ckeditor4to5upgrade_plugin_info_alter is the correct approach. It looks good to me.

    @neclimdul re linking the embedded entity with a wrapping div, hmm I don't think that'll worth either. See the markup that was tried 🐛 [upstream] [GHS] CKEditor 5 removes s that wrap HTML elements not natively supported by CKEditor 5 Fixed which seems to use a wrapping div.

  • @drunir I believe you are using the views_entity_embed module. I don't think it is CKEditor5 ready yet.

  • Open in Jenkins → Open on Drupal.org →
    Core: 10.1.x + Environment: PHP 8.1 & MySQL 8
    last update over 1 year ago
    82 pass, 2 fail
  • Assigned to wim leers
  • Status changed to Needs work over 1 year ago
  • 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺

    Working on:

    This also really should have some test coverage.

    I think you can reuse a lot from Drupal core's MediaTest. For example:

    • \Drupal\Tests\ckeditor5\FunctionalJavascript\MediaTest::testPreviewUsesDefaultThemeAndIsClientCacheable()
    • \Drupal\Tests\ckeditor5\FunctionalJavascript\MediaTest::testEmbedPreviewAccess()
    • \Drupal\Tests\ckeditor5\FunctionalJavascript\MediaTest::testAlignment()
    • \Drupal\Tests\ckeditor5\FunctionalJavascript\MediaTest::testEditableCaption()

    That should save you a lot of time :)

    Of course, starting with just porting entity_embed's \Drupal\Tests\entity_embed\FunctionalJavascript\CKEditorIntegrationTest::testIntegration() to test the CKEditor 5 equivalent would be a great start! 😊

    (I wrote that in #24, in September 2022.)

  • 🇺🇸United States dave reid Nebraska USA

    Just a heads up that I'm working on trying to get an updated Embed module release out today so we can run tests properly here.

  • 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺
    • First, catching up on what happened since #47 (January 2023):
    • Thanks @MrDaleSmith for= updating the version requirements, looks good 👍
    • Thanks @el7cosmos for addressing @lauriii's review at https://git.drupalcode.org/project/entity_embed/-/merge_requests/12#note..., looks good! 👍
    • Thanks @el7cosmos for adding editing support! I will defer to @lauriii to review that. 😅 I did test it, and it works! 👍
    • Thanks @neclimdul for your optimism in saying in #67 this is RTBC pending embed module changes. 😁 I don't think we're quite there yet though 😅 We at the very least need one functional JS test and a kernel test for the upgrade path. We want to make sure this remains maintainable for @Dave Reid, don't we? 😊
    • @pmagunia is right in #77 that this should have equivalent SVGs — just confirmed with @Dave Reid in the room at the DrupalCon sprints 👍
    • @RedNeko: thanks for adding a CKEditor4To5Upgrade plugin! 👍 I'll write test coverage for that too 😊
  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 7.3 & MySQL 5.7
    last update over 1 year ago
    98 pass, 1 fail
  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 7.3 & MySQL 5.7
    last update over 1 year ago
    98 pass, 1 fail
  • 🇺🇸United States dave reid Nebraska USA

    I'm adding some base classes and deriver to 📌 Add CKEditor 5 compatibility and keep supporting CKEditor 4 RTBC that should reduce the amount of code necessary here and also help out the rest of the Embed ecosystem, not just this module. So testing this will be challenging until that lands in Embed just as an FYI.

    Also we noted during the DrupalCon sprints that we likely need to add a prefix to the button names, and I don't see that added to the MR yet. I'm hesitant to push up a bunch of refactors until that is also committed - I'm not sure what the state of that is @wimleers?

  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 7.3 & MySQL 5.7
    last update over 1 year ago
    122 pass
  • Issue was unassigned.
  • 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺

    #89: 👍 +1 for moving the deriver there, as discussed.

    You're right that not everything we discussed is in this MR yet: functional JS test is still in progress (it was impossible to do uninterrupted work on that at DrupalCon), and indeed the button names are not yet renamed.

    TODO:

    1. @Wim Leers: get functional JS tests working
    2. @Wim Leers: rename buttons by prefixing so that conflicts are impossible, which will require an update to the upgrade path test AND the functional JS tests, but those tests will prove that the button rename did not break anything 👍🤓
    3. @lauriii: review the JS

    I will not have time soon though. The remaining June weeks are swamped. I'll try to get this prioritized by my employer in early July.

  • 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺

    Just pushed the final commit that makes the CKEditor 4 → 5 upgrade path test coverage pass tests. That now has comprehensive test coverage and uncovered a few bugs in the process! 👍😊

  • 🇧🇪Belgium JeroenT 🇧🇪

    While working on 🐛 [Entity Browser] Tests are failing on D10 Fixed , I ran into the following issue: 🐛 [CKEditor5] Missing dependency on drupal.ajax Fixed .

    During the tests of entity_browser, the embed button in the CKEditor5 toolbar doesn't respond because the library internal.drupal.ckeditor5 doesn't have a dependency on core/drupal.ajax. In ckeditor5.js there is a method Drupal.ckeditor5.openDialog(), which calls Drupal.ajax and may fail in some cases.

    Posting it here since I think the same problem may occur here.

  • 🇮🇳India bala_28 Chennai

    I was trying the apply the entity_embed-3272732-80.patch using cweagans and it failed on two files.

    tests/modules/entity_embed_test/entity_embed_test.info.yml
    tests/modules/entity_embed_translation_test/entity_embed_translation_test.info.yml
    

    So removed those two files and using a new patch which gets applied and now able to pull the entity into ckeditor5.

    Here is my diff of composer.json

    +      "drupal/entity_embed": {
    +        "Drupal 10 & CKEditor 5 readiness[https://www.drupal.org/project/entity_embed/issues/3272732]": "https://www.drupal.org/files/issues/2023-06-19/entity_embed-3272732-93.patch"
    +      },
    +      "drupal/embed": {
    +        "CKEditor 5 compatibility[https://www.drupal.org/project/embed/issues/3309747]": "https://www.drupal.org/files/issues/2023-03-30/fix_module_embed_compatibility_CKEditor_5.patch"
    +      },
    
  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 8.1 & MariaDB 10.3.22
    last update over 1 year ago
    98 pass
  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 8.0 & MySQL 5.7
    last update over 1 year ago
    98 pass
  • 🇺🇸United States laura.gates

    #93's changes seem to be working perfectly for me on my local. I'm gonna change this to needs review so that others can weigh in.

  • Status changed to RTBC over 1 year ago
  • Status changed to Needs review over 1 year ago
  • Status changed to Needs work over 1 year ago
  • 🇺🇸United States laura.gates

    Okay - got it rolling on a lower environment and I get the following error in my php logs

    Symfony\Component\HttpKernel\Exception\HttpException: Currently, only CKEditor is supported. in Drupal\embed\Access\EmbedButtonEditorAccessCheck->checkButtonEditorAccess() (line 82 of /var/www/html/docroot/modules/contrib/embed/src/Access/EmbedButtonEditorAccessCheck.php).
    
  • 🇺🇸United States Kasey_MK

    First off - thanks for all this!

    @laura.gates as noted above, you'll need to patch the embed module 📌 Add CKEditor 5 compatibility and keep supporting CKEditor 4 RTBC as well to get rid of the "only CKEditor is supported" error.

    I'm having some trouble with embedded Paragraph entities which contain links - the links interrupt the form's tab order, so once I tab to the CKE field, I can't tab out of it to the next form element. On my screen I can briefly see the first link within a Paragraph flash as if it's selected, but the location of my cursor doesn't change - and every subsequent use of the tab button just flashes that same link. I can Shift+Tab back out of the CKE field, but I can't tab forward past it.

    If I add tabindex="-1" to links within the embedded Paragraph, all seems to work as expected, but I'm wondering if there's a better way than this:

    // Remove in-Paragraph links from the tab order to prevent breaking the edit form as a whole.
    setTimeout(noTabParagraphLinks, 1000);
    function noTabParagraphLinks() {
      $('figure.drupal-entity a').each(function() {
        $(this).attr('aria-hidden', 'true').attr('tabindex', -1);
      });
    }
  • Status changed to Needs review over 1 year ago
  • 🇪🇸Spain navneet0693 Madrid

    I am trying to put right status to this issue. According to @Wim Leers's comment in #91, I am believe this should be in "Needs Review" status.

  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 7.3 & MySQL 5.7
    last update over 1 year ago
    98 pass, 2 fail
  • 🇪🇸Spain navneet0693 Madrid

    I tested this MR along with https://www.drupal.org/project/embed/issues/3309747 📌 Add CKEditor 5 compatibility and keep supporting CKEditor 4 RTBC

    Environment config:

    Drupal 10.1 using DDev
    PHP 8.1
    Embed & Entity Embed 8.x-1.x branches with patches applied

  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 7.3 & MySQL 5.7
    last update over 1 year ago
    98 pass, 2 fail
  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 7.3 & MySQL 5.7
    last update over 1 year ago
    98 pass, 2 fail
  • 🇺🇸United States recrit

    Attached a static patch of the latest MR 12 that can be used in composer files.

  • The last submitted patch, 101: entity_embed-3272732-MR-12--20230712-101.patch, failed testing. View results
    - codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

  • Assigned to wim leers
  • Status changed to Needs work over 1 year ago
  • 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺

    Catching up!

    • I worked on this during DrupalCon Pittsburgh ~1 month ago. See #90 + #91 for where I left things.
    • #93 uploaded a patch of the MR to make it consistently applicable using cweagans/composer-patches 👍
    • @navneet0693 added some really solid improvements yesterday! 🤩

    Now working on functional JS test coverage as mentioned in #90.1.

  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 7.3 & MySQL 5.7
    last update over 1 year ago
    122 pass
  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 7.3 & MySQL 5.7
    last update over 1 year ago
    122 pass
  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 7.3 & MySQL 5.7
    last update over 1 year ago
    122 pass, 1 fail
  • Status changed to Needs review over 1 year ago
  • 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺

    Pushed functional JS test!

    It tries to port \Drupal\Tests\ckeditor5\FunctionalJavascript\MediaTest as directly as possible. This worked out well:

    • ::testConversion()
    • ::testOnlyDrupalMediaTagProcessed()::testOnlyDrupalEntityTagProcessed()
    • ::testMediaArbitraryHtml()::testEntityArbitraryHtml() ⇒ JS BUG DISCOVERED! 👍
    • 🤷‍♂️ ::testLinkedMediaArbitraryHtml()::testLinkedEntityArbitraryHtml() + ::testLinkability() + ::testLinkManualDecorator()⇒ linkability of embedded entities is still missing, but per #74, that didn't quite work in CKEditor 4 either, so it's not a regression, so we shouldn't hold this up on that.
    • ::testErrorMessages()
    • ::testPreviewUsesDefaultThemeAndIsClientCacheable()
    • 🗑️ ::testAlignment() + ::testDrupalMediaStyleInDropdown() + ::testDrupalMediaStyleWithClass() have not been ported because the alignment functionality (for now) is present solely in the Drupal dialog — that's also less disruptive because AFAIK many sites are customizing the dialog using hook_form_alter()
    • 🗑️ ::testEditableCaption() has not been ported for the same reason
    • 🗑️ ::testViewMode() has not been ported for the same reason
    • 🗑️ ::testAltDisabled(), ::testAlt() and ::testTranslationAlt() have not been ported because it's irrelevant for Entity Embed — that's special-case logic/UX for image media
    • ::testEmbedPreviewAccess()
    • ::testMediaPointerEvent()::testEntityPointerEvent() ⇒ JS BUG DISCOVERED! 👍
  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 7.3 & MySQL 5.7
    last update over 1 year ago
    98 pass, 3 fail
  • 🇺🇸United States neclimdul Houston, TX

    Hi wim!

    linkability of embedded entities is still missing, but per #74, that didn't quite work in CKEditor 4 either, so it's not a regression, so we shouldn't hold this up on that.

    Welp... problem located.

  • 🇦🇷Argentina gerzenstl Resistencia

    I tried to use the patch from #101 Drupal 10 & CKEditor 5 readiness Fixed , but in "Text formats and editors" config page, when I switch the drop-down to "CKEditor 5" I get the following error in the ajax request:

    TypeError: Drupal\entity_embed\Plugin\CKEditor4To5Upgrade\EntityEmbed::__construct(): Argument #3 ($plugin_definition) must be of type Drupal\ckeditor5\Plugin\CKEditor4To5UpgradePluginInterface, array given, called in /app/web/modules/contrib/entity_embed/src/Plugin/CKEditor4To5Upgrade/EntityEmbed.php on line 67 in Drupal\entity_embed\Plugin\CKEditor4To5Upgrade\EntityEmbed->__construct() (line 50 of /app/web/modules/contrib/entity_embed/src/Plugin/CKEditor4To5Upgrade/EntityEmbed.php)

    BTW: the patch from #93 Drupal 10 & CKEditor 5 readiness Fixed works fine.

    My environment:
    * Drupal 9.5.9
    * PHP 8.0
    * embed 1.6
    * entity_embed 1.4

    I tried to use the patch from #101 Drupal 10 & CKEditor 5 readiness Fixed , but in "Text formats and editors" config page, when I switch the drop-down to "CKEditor 5" I get the following error in the ajax request:

    TypeError: Drupal\entity_embed\Plugin\CKEditor4To5Upgrade\EntityEmbed::__construct(): Argument #3 ($plugin_definition) must be of type Drupal\ckeditor5\Plugin\CKEditor4To5UpgradePluginInterface, array given, called in /app/web/modules/contrib/entity_embed/src/Plugin/CKEditor4To5Upgrade/EntityEmbed.php on line 67 in Drupal\entity_embed\Plugin\CKEditor4To5Upgrade\EntityEmbed->__construct() (line 50 of /app/web/modules/contrib/entity_embed/src/Plugin/CKEditor4To5Upgrade/EntityEmbed.php)tch from #93 Drupal 10 & CKEditor 5 readiness Fixed works fine.

    My environment:
    * Drupal 9.5.9
    * PHP 8.0
    * embed 1.6
    * entity_embed 1.4

  • It couldn't be applied in 1.4, so I made a temporary patch.

  • Open in Jenkins → Open on Drupal.org →
    Core: 10.1.x + Environment: PHP 8.1 & MySQL 8
    last update over 1 year ago
    72 pass, 4 fail
  • 🇺🇸United States pmagunia Philadelphia 🇺🇸

    The latest from MR12 didn't apply cleanly. This is the URL I used on the 1.x-dev version of the module:

    https://git.drupalcode.org/project/entity_embed/-/merge_requests/12.patch

    The entity_embed.info.yml and entity_embed.module files were out of sync.

    Even after applying the changes manually the embed icons were missing for me on the text format config page.

    #93 worked well for me though.

  • 🇦🇺Australia darvanen Sydney, Australia

    Thanks everyone for all the hard work on this!

    I wonder if it was intentional to set embedded entities to only be allowed at the block level? I'm looking after a site at the moment which embeds entities within text, and upon updating those have all been shunted up the DOM when opened in ckeditor5.

    I messed around a bit with the options in _defineSchema():

        schema.register('drupalEntity', {
          isObject: true,
          isContent: true,
          isBlock: false,
          allowWhere: ['$block', '$text'],
          allowAttributes: Object.keys(this.attrs),
        });

    to no avail. For reference this is using paragraph_inline_entity_form module to embed a couple of words which open into a tooltip on hover for displaying academic references, they very much need to be in-text.

  • 🇺🇸United States percoction

    In Text formats and editors config the new default entity.svg embed button icon is properly being loaded for ckeditor5 editors, but in Embed buttons config the old default entity.png icon is being loaded.

    This is also being reported as an error on the status report page

  • 🇺🇸United States Kristen Pol Santa Cruz, CA, USA

    Hmm... the fix is bouncing between MRs and patches which is pretty confusing.

    @Wim Leers This is still assigned to you. Would be curious for your assessment on next steps here please :)

  • Issue was unassigned.
  • Status changed to Needs work over 1 year ago
  • 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺

    @Kristen Pol The MR contains the truth. The patches are just extracted from the MR, to have a stable patch to apply (every commit to the MR would change the auto-generated patch from the MR). This is a limitation of GitLab 🤷‍♂️

    I should've unassigned this issue from me in #104, sorry. I am not sufficiently proficient in the CKEditor 5 JS APIs to efficiently fix this. I'm hoping @lauriii can do that in the next few weeks. (He, @nod_ and @bnjmnm wrote >90% of the JS for the CKEditor 5 module!)

    Basically: as soon as all functional JS tests I added pass, I'd instantly RTBC, commit and ship this 🤓 (Not because I wrote those tests, but because they're ported from Drupal core's similar "media embed" functionality, which is very thoroughly tested after years of deep reviews and edge case testing!)

  • 🇺🇸United States Kristen Pol Santa Cruz, CA, USA

    Thanks for the great summary of status and next steps 🙏

  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 7.3 & MySQL 5.7
    last update over 1 year ago
    98 pass, 3 fail
  • 🇺🇸United States percoction

    Hey, just pushed a commit to address the issue I mentioned in #110 Drupal 10 & CKEditor 5 readiness Fixed

    Please let me know if there is any related code that I should update besides this.

    (I could also clean up that \Drupal::service() call and properly inject the extension.list.module service while I'm at it)

  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 7.3 & MySQL 5.7
    last update over 1 year ago
    PHPLint Failed
  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 7.3 & MySQL 5.7
    last update over 1 year ago
    PHPLint Failed
  • 🇺🇸United States mortona2k Seattle

    Got this up and running! Many thanks to everyone working on this.

  • 🇦🇺Australia jannakha Brisbane!

    I installed it on clean D10, added patch from MR and I'm getting the following errors:


  • First commit to issue fork.
  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 7.3 & MySQL 5.7
    last update over 1 year ago
    Composer config failure
  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 8.0 & MySQL 5.7
    last update over 1 year ago
    98 pass, 3 fail
  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 7.3 & MySQL 5.7
    last update over 1 year ago
    98 pass, 3 fail
  • 🇮🇩Indonesia el7cosmos 🇮🇩 GMT+7

    Attaching static patch with HEAD at 4d4809529ccfbe64c7488d4438f92e1bff52b900

  • 🇦🇺Australia acbramley

    Everything's working well, except this functionality Image entities/fields embedded using Entity Embed cannot be linked in CKEditor Fixed it's not possible to create a link around an embedded entity in CKE5

  • 🇦🇺Australia darvanen Sydney, Australia

    Yeah that's effectively the same as my issue per #109

  • 🇦🇺Australia jannakha Brisbane!

    So this is a OOTB media embed of CKEditor 5 and it has a link feature:

    Maybe entity-embed should have something similar?

    To speed up release - maybe this feature should be a separate issue?

  • 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺

    #120: that's known. See the tests I added and the summary of what passes and fails in #104. Apparently I fixed this in 2019 over at #2511404-77: Image entities/fields embedded using Entity Embed cannot be linked in CKEditor and committed it in #81 there?! 😳😅 I have no recollection of this! 👴

    That means that in #104, the 4th bullet with the "🤷‍♂️" should really be a "❌" too. That means there are THREE bugs to be fixed in the JS, not TWO.

    @jannakha We can't release this as-is, because that could result in data loss (links disappearing) when editing existing content with linked embedded entities using CKEditor 5.

  • 🇭🇺Hungary pasqualle 🇭🇺 Budapest

    Should entity_embed work with the "Limit allowed HTML tags and correct faulty HTML" filter? The embedded entity is not displayed when I have that filter enabled.

  • 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺

    @Pasqualle Yes, it should, and it does. The test coverage proves it does. The filters must be ordered correctly though. entity_embed_filter_format_edit_form_validate() ensures the order is valid. The only ways it cannot work: the FilterFormat on your site was created with that validation logic disabled and/or a new bug. If it's the latter, please create a new issue 😊🙏

  • Open in Jenkins → Open on Drupal.org →
    Core: 10.1.x + Environment: PHP 8.1 & MySQL 5.7
    last update about 1 year ago
    72 pass, 4 fail
  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 7.3 & MySQL 5.7
    last update about 1 year ago
    98 pass, 3 fail
  • 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺

    Clarified the remaining work.

    Fixed the pointer test by porting the (CSS-only) fix from 🐛 [drupalMedia] When media is embedded in a view mode whose display is configured to link elsewhere, that link should not be clickable in CKEditor Fixed 👍

    2 JS bugs left.

  • 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺

    For the two remaining JS bugs surfaced in #104, we need to port:

    1. ::testEntityArbitraryHtml() #3231337: [drupalMedia] Remove manual dataDowncast from DrupalMediaEditing
    2. ::testLinkManualDecorator() #3248228: Unable to change selection after linking inline media when manual decorators have been defined

    … and maybe more. But at least the patterns in those issues should help a lot in getting this closer to the finish line.

    Anybody interested? 🤞

  • 🇪🇸Spain navneet0693 Madrid

    @Wim Leers,

    I am willing to offer help, but it seems that my knowledge is limited, I am highly willing to make point 2 in #127 work.

  • Observation:-
    if you add a piece of media using the entity embed on the formatting toolbar, then close out without making a selection, you are taken to the top of the body section.
    Steps to reproduce
    * Navigate to the bottom of the body content section
    * Place your cursor
    * Select the “entity embed icon”
    * Click the “x” in the top right corner without making a selection
    * See that you are taken to the top of the body section

  • 🇨🇳China randy tang

    If the content inside

  • will jump outside the
      tag. I added to allow the module to be put into blocks

      Fill in source with “

      • test


      Save the node and check CKeditor source
      now result:The source position of the image is outside the ul tag

      expect result:The source location of the image is inside the ul tag

      schema.register('drupalEntity', {
      isObject: true,
      isContent: true,
      isBlock: true,
      allowWhere: '$block',
      + allowIn: ["$block", "$root", "$container", "$blockObject"],
      allowAttributes: Object.keys(this.attrs),
      });

      Based on the patch created on the 93rd floor

  • Open in Jenkins → Open on Drupal.org →
    Core: 10.1.x + Environment: PHP 8.1 & MySQL 8
    last update about 1 year ago
    72 pass, 4 fail
  • 🇨🇦Canada smulvih2 Canada 🍁

    #93 works great (with the patch to drupal/embed)

  • 🇺🇸United States janusman

    Just adding "Drupal 10 compatibility" label.

  • 🇺🇸United States joegraduate Arizona, USA

    Attaching latest diff from MR !12 as static patch for composer builds.

  • 🇺🇸United States trackleft2 Tucson, AZ 🇺🇸

    I was looking at the 2 Errors in the PHPUnit tests, and I am thinking that they are because the aria labels have changed

    There were 2 errors:

    1) Drupal\Tests\entity_embed\FunctionalJavascript\CKEditor5IntegrationTest::testLinkManualDecorator with data set "restricted" (false)
    Behat\Mink\Exception\ElementNotFoundException: Element matching css ".ck-balloon-panel_visible .ck-balloon-rotator__content > .ck.ck-toolbar[aria-label="Drupal Entity toolbar"]" not found.

    /var/www/html/vendor/behat/mink/src/WebAssert.php:418
    /var/www/html/core/tests/Drupal/Tests/WebAssert.php:968
    /var/www/html/core/modules/ckeditor5/tests/src/Traits/CKEditor5TestTrait.php:116
    /var/www/html/modules/contrib/entity_embed/tests/src/FunctionalJavascript/CKEditor5IntegrationTest.php:608
    /var/www/html/vendor/phpunit/phpunit/src/Framework/TestResult.php:703

    2) Drupal\Tests\entity_embed\FunctionalJavascript\CKEditor5IntegrationTest::testLinkManualDecorator with data set "unrestricted" (true)
    Behat\Mink\Exception\ElementNotFoundException: Element matching css ".ck-balloon-panel_visible .ck-balloon-rotator__content > .ck.ck-toolbar[aria-label="Drupal Entity toolbar"]" not found.

    /var/www/html/vendor/behat/mink/src/WebAssert.php:418
    /var/www/html/core/tests/Drupal/Tests/WebAssert.php:968
    /var/www/html/core/modules/ckeditor5/tests/src/Traits/CKEditor5TestTrait.php:116
    /var/www/html/modules/contrib/entity_embed/tests/src/FunctionalJavascript/CKEditor5IntegrationTest.php:608
    /var/www/html/vendor/phpunit/phpunit/src/Framework/TestResult.php:703

    And we could probably fix this by changing the text to "Drupal Media toolbar"

  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 7.3 & MySQL 5.7
    last update about 1 year ago
    98 pass, 3 fail
  • 🇺🇸United States trackleft2 Tucson, AZ 🇺🇸

    #135 was wrong, and we should probably revert that change, and #127 still stands as the path forward.

  • 🇺🇸United States pcate

    In my manual testing of the functionality covered in the testEntityArbitraryHtml test, it indeed did not work. Do we need to implement a version of the "DrupalMediaGeneralHtmlSupport" plugin the core CKEditor5 module has for this functionality?

  • First commit to issue fork.
  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 7.3 & MySQL 5.7
    last update about 1 year ago
    98 pass, 3 fail
  • 🇺🇸United States pcate

    I added a general html support plugin based off of the one in core media. This should fix the testEntityArbitraryHtml test.

  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 7.3 & MySQL 5.7
    last update about 1 year ago
    98 pass, 3 fail
  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 7.3 & MySQL 5.7
    last update about 1 year ago
    98 pass, 3 fail
  • 🇺🇸United States pcate

    I added a link plugin ported from core's DrupalLinkMedia plugin. This should fix the testLinkedEntityArbitraryHtml test.

  • Open in Jenkins → Open on Drupal.org →
    Core: 10.1.x + Environment: PHP 8.1 & MySQL 8
    last update about 1 year ago
    72 pass, 7 fail
  • Open in Jenkins → Open on Drupal.org →
    Core: 10.1.x + Environment: PHP 8.1 & MySQL 8
    last update about 1 year ago
    72 pass, 7 fail
  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 7.3 & MySQL 5.7
    last update about 1 year ago
    113 pass, 1 fail
  • 🇺🇸United States pcate

    I added the CKEditor link ui plugin to the entity embed balloon so the testLinkability and testLinkManualDecorator tests could run.

    I did also have to update some of the assertions in those tests to reflect the test data. For instance the test data didn't have an image. I think I updated the assertions in such a way that they are still effectively testing the same functionality.

    Of course all the changes I've made should be reviewed thoroughly.

    The only test I see still failing is the UpgradePathTest test. I think that's related to the missing data-view-mode attribute.

  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 7.3 & MySQL 5.7
    last update about 1 year ago
    137 pass
  • Status changed to Needs review about 1 year ago
  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 7.3 & MySQL 5.7
    last update about 1 year ago
    98 pass, 3 fail
  • 🇺🇸United States pcate

    OK, looks like all the tests are passing now. Setting to "Needs review".

  • The last submitted patch, 118: entity_embed-3272732-118-4d480952.patch, failed testing. View results
    - codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

  • 🇧🇪Belgium BramDriesen Belgium 🇧🇪

    Such dedication @PCate! Great job 😉

    Added one comment, didn't check everything yet.

  • 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺

    @PCate: 🤯🤩 HOLY COW! That is incredible, thank you so much! 👏🙏

    I'm hoping that @bnjmnm or @lauriii can review this soon 🤓🤞 But it looks fantastic!

  • 🇪🇸Spain navneet0693 Madrid

    @PCate: 🔥🙌

    Superb work ! thank you so much for pushing this.

  • 🇺🇸United States bnjmnm Ann Arbor, MI

    I'm going to put some quality time into reviewing the current MR. Thanks to @PCate it is looking quite good!

  • 🇺🇸United States bnjmnm Ann Arbor, MI

    Found an issue with core that prevents the embed module from allowing svg uploads for the button config: 🐛 FileUploadHandler::handleExtensionValidation does not have fallback for sites still using file_validate_extensions Needs work

    This can also be addressed in the embed module with a one line addition. That might get committed faster, too, so I also created 🐛 Button icon extension validation settings do not work with versions >= 10.2 or < 11 Active

    The MR here still needs JS that accounts for non-SVG button images. More info in the MR.

  • @jannakha opened merge request.
  • 🇦🇺Australia acbramley

    The latest changes in MR12 seem to be working well, the linking is working great :)

  • 🇺🇸United States sea2709 Texas

    The changes in MR12 seem working fine. I applied these changes for a project I'm working on. I run into issue with alignment. If the is aligned right, then I cannot select the entity.

    I think the class align-right should be applied at the tag

  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 7.3 & MySQL 5.7
    last update about 1 year ago
    122 pass, 1 fail
  • 🇺🇸United States bnjmnm Ann Arbor, MI

    @darvanen in #109 you mention needing to preserve the ability to embed entities inline within text like you do with CKEditor 4. I did some manual testing with CKEditor 4 + Entity Embed and this kind of in-text embedding does not seem to be supported, but perhaps there's a step I'm missing. I'll demonstrate what currently happens for me:
    If I start with this:

    <h2>Rice milk</h2>
    
    <p>The flavor of rice milk perfectly complements the cocoa beans and it was one of the first dairy milk alternatives to be used to create vegan milk chocolate. Rice milk is made from rice powder and is sometimes combined with hazelnut milk to create the correct texture and taste that is ideal for producing all kinds of chocolate bars.</p>

    Then embed an entity mid-sentence or mid-word, the single paragraph is split into two paragraphs with the embed between them

    <h2>Rice milk</h2>
    
    <p>The fla</p>
    
    <drupal-entity data-embed-button="node" data-entity-embed-display="entity_reference:entity_reference_label" data-entity-embed-display-settings="{&quot;link&quot;:1}" data-entity-type="node" data-entity-uuid="05f5c4f3-73e7-4eb5-a971-a297e445a8b0" data-langcode="en"></drupal-entity>
    
    <p>vor of rice milk perfectly complements the cocoa beans and it was one of the first dairy milk alternatives to be used to create vegan milk chocolate. Rice milk is made from rice powder and is sometimes combined with hazelnut milk to create the correct texture and taste that is ideal for producing all kinds of chocolate bars.</p>

    Based on the above I'm not sure this something directly supported by Entity Embed. Perhaps the inlining is made possible by a additional contrib or custom module? If you have steps to reproduce that accomplish this in CKEditor(4) with just Entity Embed, please share. If it's demonstrated that Entity Embed's CKEditor4 functionality supports inlining without additional help, then the CKEditor 5 version should support it as well, but it's not yet clear if Entity Embed can do that independently.

  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 7.3 & MySQL 5.7
    last update about 1 year ago
    122 pass, 1 fail
  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 7.3 & MySQL 5.7
    last update about 1 year ago
    44 pass, 35 fail
  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 8.1 & MariaDB 10.3.22
    last update about 1 year ago
    44 pass, 35 fail
  • Open in Jenkins → Open on Drupal.org →
    Core: 10.1.x + Environment: PHP 8.1 & MySQL 8
    last update about 1 year ago
    44 pass, 35 fail
  • 🇺🇸United States bnjmnm Ann Arbor, MI

    Re #151 good catch! Commit 066e6299 addresses this by moving the align classes to the widget container in the editing downcast conversion. This functionality is verified by \Drupal\Tests\entity_embed\FunctionalJavascript\CKEditor5IntegrationTest::testAlignClassAddedToWrapperWhileEditing. This might address the concerns in #109 as well, if the inlining was dependent on the alignment classes being applied to the correct element.

  • 🇺🇸United States bnjmnm Ann Arbor, MI

    It looks like my recent commits have CKEditor5IntegrationTest failing. Based on the failures, it looks like CKEditor 5 is not initializing.
    This is passing for me locally, but I'm on core 10.x lcoally. It looks like shortly after my commit @Dave Reid added the ability to test on 10 so I'll see if I also have that capability on my next push.

  • 🇺🇸United States dave reid Nebraska USA

    I just tagged a release of Embed module so we might need to re-run with that (and also bump the requirements to that version).

  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 7.3 & MySQL 5.7
    last update about 1 year ago
    122 pass, 1 fail
  • Open in Jenkins → Open on Drupal.org →
    Core: 10.1.x + Environment: PHP 8.1 & MySQL 5.7
    last update about 1 year ago
    122 pass, 1 fail
  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 7.3 & MySQL 5.7
    last update about 1 year ago
    122 pass, 1 fail
  • Open in Jenkins → Open on Drupal.org →
    Core: 10.1.x + Environment: PHP 8.1 & MySQL 5.7
    last update about 1 year ago
    140 pass
  • 🇺🇸United States dave reid Nebraska USA

    @bnjmnm Can you revert the changes to skipping tests? I think that would be resolved by using GitLab CI since I don't think DrupalCI was downloading the contributed ckeditor module.

  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 7.3 & MySQL 5.7
    last update about 1 year ago
    140 pass
  • Open in Jenkins → Open on Drupal.org →
    Core: 10.1.x + Environment: PHP 8.1 & MySQL 5.7
    last update about 1 year ago
    140 pass
  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 7.3 & MySQL 5.7
    last update about 1 year ago
    140 pass
  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 7.3 & MySQL 5.7
    last update about 1 year ago
    140 pass
  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 7.3 & MySQL 5.7
    last update about 1 year ago
    140 pass
  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 7.3 & MySQL 5.7
    last update about 1 year ago
    98 pass
  • 🇺🇸United States bnjmnm Ann Arbor, MI

    This patch is just to test using the contrib CKEditor4 module for tests, to confirm it will cooperate with 9 and 10. Don't expect to see any actual functionality here 🙂

  • Open in Jenkins → Open on Drupal.org →
    Core: 10.1.x + Environment: PHP 8.1 & MySQL 5.7
    last update about 1 year ago
    72 pass, 4 fail
  • 🇺🇸United States bnjmnm Ann Arbor, MI

    Re #156

    Can you revert the changes to skipping tests? I think that would be resolved by using GitLab CI since I don't think DrupalCI was downloading the contributed ckeditor module.

    On the way - I mistakenly thought it was necessary due to (long story). However, based on #157 (which is basically testing HEAD on 9 and 10) it does look like some adjustments will need to be made for a few tests using CKEditor 4 to pass on Drupal 10, but since some CK4 tests are still passing it hopefully means just updating some selectors.

  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 7.3 & MySQL 5.7
    last update about 1 year ago
    122 pass, 1 fail
  • Open in Jenkins → Open on Drupal.org →
    Core: 10.1.x + Environment: PHP 8.1 & MySQL 5.7
    last update about 1 year ago
    140 pass
  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 7.3 & MySQL 5.7
    last update about 1 year ago
    140 pass
  • Open in Jenkins → Open on Drupal.org →
    Core: 10.1.x + Environment: PHP 8.1 & MySQL 5.7
    last update about 1 year ago
    140 pass
  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 7.3 & MySQL 5.7
    last update about 1 year ago
    140 pass
  • Open in Jenkins → Open on Drupal.org →
    Core: 10.1.x + Environment: PHP 8.1 & MySQL 5.7
    last update about 1 year ago
    140 pass
  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 7.3 & MySQL 5.7
    last update about 1 year ago
    140 pass
  • Open in Jenkins → Open on Drupal.org →
    Core: 10.1.x + Environment: PHP 8.1 & MySQL 5.7
    last update about 1 year ago
    140 pass
  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 7.3 & MySQL 5.7
    last update about 1 year ago
    140 pass
  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 7.3 & MySQL 5.7
    last update about 1 year ago
    140 pass
  • 🇺🇸United States neclimdul Houston, TX

    Did a quick test of this and it looks and works amazing! Great work!

  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 7.3 & MySQL 5.7
    last update about 1 year ago
    140 pass
  • Open in Jenkins → Open on Drupal.org →
    Core: 10.1.x + Environment: PHP 7.3 & MySQL 5.7
    last update about 1 year ago
    Composer error. Unable to continue.
  • Open in Jenkins → Open on Drupal.org →
    Core: 10.1.x + Environment: PHP 8.1 & MySQL 8
    last update about 1 year ago
    140 pass
  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 7.3 & MySQL 5.7
    last update about 1 year ago
    140 pass
  • Open in Jenkins → Open on Drupal.org →
    Core: 10.1.x + Environment: PHP 8.1 & MySQL 5.7
    last update about 1 year ago
    140 pass
  • 🇺🇸United States dave reid Nebraska USA
  • Status changed to Fixed about 1 year ago
  • 🇺🇸United States dave reid Nebraska USA

    Merged the changes to 8.x-1.x. Thank you so much every, it means the world that all of you helped get this across the finish line. Thank you.

    I will work on filing any follow-up issues needed:

    1. Making the caption feature work better with native CKEditor5 instead of using the caption filter.

    I think it would be good to give this a day more of testing with everyone else on the 8.x-1.x-dev before I tag a release as well, if that's okay.

  • 🇺🇸United States Deasly

    When I install the new Oct 20th Dev version or apply the most recent version of the patch (https://git.drupalcode.org/project/entity_embed/-/merge_requests/12.diff) to 1.4.0 I am getting js errors in the console and the Ckeditor UI is not loading in the following scenario:

    When I start a node creation page for any content with Ckeditor 5 field using a format that has the ability to embed entities the editor fails to load. When I switch to a format on that textarea that doesn't embed entities the editor loads. Also if I disable the embed entities ability in my format that is broken, and save it, the editor loads again for that format. The error I receive on the front end is the following:

    ckeditor5.js?s2yxym:201 TypeError: Cannot read properties of null (reading 'getAttribute')
        at Object.callback (drupalentity.js?s2yxym:1:6039)
        at i.create (ckeditor5-dll.js?v=35.4.0:5:416819)
        at ckeditor5-dll.js?v=35.4.0:5:439488
        at Array.map (<anonymous>)
        at X.fillFromConfig (ckeditor5-dll.js?v=35.4.0:5:439398)
        at $.register (ckeditor5-dll.js?v=35.4.0:5:555056)
        at s.afterInit (drupalentity.js?s2yxym:1:6609)

    Strangely enough, I used this patch on another site built practically the same exact way a couple weeks ago with that same patch from around Oct4 on module version 1.4.0 and it's still running fine. So something that has changed since then is what seems to be causing the issue. Just to be sure I copied that entity embed module patched version from the Oct 4th working site into the current one that isn't working and my formats are working again.

    Not sure if anyone else is getting this issue. Hope this helps. Kind of a blocking issue for me to update a client site to Drupal 10. As they won't be able to manage any of their embedded media in any content without this patch. If I can help give any more context let me know.

  • 🇮🇳India siddharthjain

    Yes, I am also facing this same above issue after using the latest dev version while updating from Ckeditor4 to Ckeditor5, the editor does not loads up. Also if I disable embed options on a text format the editor loads normally without any error, also my site is already on D10 latest version

  • Status changed to Needs review about 1 year ago
  • 🇮🇳India sahilgidwani Jaipur
    1. After applying the patch mentioned in #163 Drupal 10 & CKEditor 5 readiness Fixed and clearing the cache, I am getting the following error.
    2. Error: Call to undefined method Drupal\entity_embed\Plugin\EmbedType\Entity::getModulePath() in Drupal\entity_embed\Plugin\EmbedType\Entity->getDefaultIconUrl() (line 243 of modules/contrib/entity_embed/src/Plugin/EmbedType/Entity.php).
    3. And also, as mentioned in #162 Drupal 10 & CKEditor 5 readiness Fixed , the PR is not merged yet, so reopening this issue.
    4. Correct me if I am wrong somewhere in my understanding.
  • 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺

    @Deasly, @siddharthjain and @sahilgidwani: Did you also update drupal/embed to 1.7 or newer? (The minimum version of that dependency has been updated by this MR.)

  • 🇮🇳India siddharthjain

    @Wim Leers, Yes I have updated the embed module to latest version i.e. 1.7

  • 🇩🇪Germany h1nds1ght

    I am facing the same issue as described in #163 using embed 1.7 and dev version (ac6f2fe1). For some reason getSelectedElement is null and therefore the succeeding code fails.

                    e.ui.componentFactory.add("editEmbeddedEntity", (i=>{
                        const r = new a.ButtonView(i)
                          , n = e.model.document.selection.getSelectedElement()
                          , o = n.getAttribute("drupalEntityEntityUuid")
                          , s = n.getAttribute("drupalEntityEntityType")
                          , l = Drupal.url(`entity-embed/edit-embedded/${s}/${o}`);
    
  • Status changed to Fixed about 1 year ago
  • 🇺🇸United States dave reid Nebraska USA

    My intent in that comment was the PR was in fact merged. I think we should file follow-up issues for anything that is being reported. Everyone, please file new bug reports only after confirming that your version of the Embed module is the 1.7 release.

  • 🇺🇸United States Deasly

    Hi @Wim Leers i was also using the with the drupal/embed module at 1.7 as per the requirements and still having the issue.

    I created a new issue queue as per Dave Reid's request here: https://www.drupal.org/project/entity_embed/issues/3396133 🐛 Ckeditor 5 Interface not loading on text formats using entity embed Active

    I hope I did this the right way.

  • 🇺🇸United States trackleft2 Tucson, AZ 🇺🇸

    We were having the same issue as described in #163, but it turned out to be our hosting provider being the problem (Pantheon). We applied the patch using cweagans/composer-patches. on a Pantheon multidev (which does not show composer logs).

    Apparently, sometimes composer patches just doesn't work on multidevs (possibly due to the size of this patch now with lots of tests).

    Long story short, if you see this issue and are using cweagans/composer-patches, on a pantheon multidev with integrated composer you can possibly fix it by forcing composer to rebuild a couple of times by deleting the lock file.

    Anyway, I think this patch is ready to be included in a release, after testing this for 3 days.

  • 🇺🇸United States DamienMcKenna NH, USA

    FYI at this point you shouldn't be still using the patches, you should use the dev release and report any problems to new issues.

  • 🇨🇦Canada mhentry Toronto

    @bnjmnm in #153 you tried to embed an entity mid-sentence or mid-word, the single paragraph is split into two paragraphs with the embed between them is not a default behavior, there is a issue thread with patch regards to that to preserve the inline entity embed, I am using that patch for our D9 site.

    please check this one https://www.drupal.org/project/entity_embed/issues/2640398 Allow elements to be inline CKEditor Widgets Needs review , if we can make the inline entity embed to work on CKEditor5 would be great.

  • @jannakha opened merge request.
  • 🇺🇸United States bnjmnm Ann Arbor, MI

    Re #173. Perhaps I'm reading this incorrectly, but are asking for functionality that is not part of a tagged release, but only available y applying a patch from the issue Allow elements to be inline CKEditor Widgets Needs review ?

  • 🇺🇸United States EthanT Sarasota, Florida

    @bnjmnm, yeah the patches in https://www.drupal.org/project/entity_embed/issues/2640398 Allow elements to be inline CKEditor Widgets Needs review don't work with any version of CK5. Would be great to be able to embed entities inline like we can with CK4.

  • 🇺🇸United States bnjmnm Ann Arbor, MI

    @bnjmnm, yeah the patches in https://www.drupal.org/project/entity_embed/issues/2640398 Allow elements to be inline CKEditor Widgets Needs review don't work with any version of CK5. Would be great to be able to embed entities inline like we can with CK4.

    The first step towards getting there would be completing the issue you referenced: Allow elements to be inline CKEditor Widgets Needs review .

    This issue's scope was for ensuring that any existing (I.e. in a tagged relase) CKEditor 4 features are also supported by CKEditor 5, and that appears to be complete.

    The inline embed functionality is only provided in an issue that has not been completed (#2640398). It would be reasonable to expand the scope of #2640398 to include CKEditor 5, but this issue was specific to providing CKEditor 5 support for an unpatched entity embed.

  • 🇦🇺Australia darvanen Sydney, Australia

    For anyone needing a fix *right now* the work in MR28 was commissioned to unstick a client project, it adds an 'inline' embed style, thanks so much @jannakha!

  • 🇮🇳India dishabhadra

    I am using the drupal/embed module at 1.7 and applied the patch for entity_embed https://git.drupalcode.org/project/entity_embed/-/commit/ac6f2fe13b18f5f...

    It's working fine for me with the Drupal 10 version.

    @Dave Reid Please let me know when the new CK5 compatible version of the module will be released.

  • 🇺🇸United States dave reid Nebraska USA

    Release including this and the follow-up fix was made today. Please report any followups as separate issues.

  • 🇨🇭Switzerland ytsurk Switzerland

    What a story - thank you all for the hard and intense work!

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

  • Status changed to Fixed 3 months ago
  • I upgraded my Drupal version to 10.3.2 and met the same issue with entity_embed:
    Error: Call to undefined method Drupal\entity_embed\Plugin\EmbedType\Entity::getModulePath() in Drupal\entity_embed\Plugin\EmbedType\Entity->getDefaultIconUrl() (line 243 of modules/contrib/entity_embed/src/Plugin/EmbedType/Entity.php).

    I upgraded the version of entity_embed in my composer.json file to version 1.6 (1.7 doesn't exist apparently) but the issue remained,
    I had to apply the same patch mentioned in https://www.drupal.org/project/entity_embed/issues/3272732#comment-15306099 Drupal 10 & CKEditor 5 readiness Fixed .

    Was entity_embed 1.7 removed? How can we make sure the patch from https://git.drupalcode.org/project/entity_embed/-/commit/ac6f2fe13b18f5f... is included in the entity_embed package?

  • 🇺🇸United States trigdog

    @pyxy - I think the 1.7 minimum requirement was for the Embed module not entity_embed.

  • Production build 0.71.5 2024