Ckeditor - Alter edit link on specific entity (paragraph)

Created on 23 August 2024, 11 months ago
Updated 27 August 2024, 10 months ago

Edit link of specific entity, as paragraph, don't work

I updated the module to use ckeditor 5 (before I was using ckeditor 4). With ckeditor 4 I had set up a text embed button to manage paragraphs inside my text.

On Ckeditor 5 I kept the button to manage paragraphs. But when I edit the previously inserted paragraphs (icon settings), I get on a page error with this message :

Symfony\Component\Routing\Exception\RouteNotFoundException : Route "entity.paragraph.edit_form" does not exist.

This makes sense, for paragraphs the route to edit the entity does not exist.

Is there a solution to alter the editing links/options on entities? I don't see this in the button settings.

Thanks for your help.

💬 Support request
Status

Active

Version

1.6

Component

CKEditor integration

Created by

🇫🇷France kumkum29

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

Comments & Activities

  • Issue created by @kumkum29
  • 🇫🇷France kumkum29

    same problem in this issue https://www.drupal.org/project/entity_embed/issues/3416512 🐛 Trying to edit embedded entities causes uncaught exception Needs review

  • 🇫🇷France kumkum29

    After analyse, i see that the edit entity button is built with this code :

        editor.ui.componentFactory.add('editEmbeddedEntity', (locale) => {
          let buttonView = new ButtonView(locale);
    
          buttonView.set({
            isEnabled: true,
            label: Drupal.t('Edit the embedded entity (opens in new tab)'),
            icon: icons.cog,
            tooltip: true,
          });
    

    How can I easily hide this button ? (value isEnabled > false ? )

    Thanks.

  • 🇫🇷France kumkum29

    Hello,

    I tried to remove the component 'edit embedded entity' to simplify the interface without success. Here is my code, in a custom JS (attached in module library).

              if (componentFactory.has('editEmbeddedEntity')) {
                // Remove the 'editEmbeddedEntity' component.
                console.log('Remove component');
                componentFactory._components.delete('editembeddedentity');
              }
    

    However, I can clearly see the console log message but the component (edit embedded entity) is not removed when I click on the entity embed.

    Thanks for your help.

Production build 0.71.5 2024