Problem/Motivation

I don't know how this was supposed to work, maybe sth. changed with Drupal >11?

1. The callback to /ckeditor5/api/annotations won't fire:

The code searches e.g. for drupalSettings.ckeditor5Premium.mentions.marker. But this doesn't exist, the marker is nested e.g. like this: drupalSettings.ckeditor5Premium.mentions.basic_html.0.marker --- this also counts for the minimumCharacter setting.

2. The MentionAutocompleteController exits early as of missing mention-id:

if (empty($args->get('id'))) {
  return new JsonResponse([]);
}
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

drupatz created an issue. See original summary.

drupatz’s picture

Status: Active » Needs work
drupatz’s picture

Status: Needs work » Needs review
drupatz’s picture

There is a bug in this mr. The selected text is cut off after 7 characters

drupatz’s picture

Status: Needs review » Needs work
drupatz’s picture

Status: Needs work » Needs review
maris.abols’s picture

Run into same problem that in Drupal 11 plugin is just not working, no errors no nothing. Changes above worked for me!

sujan shrestha’s picture

Status: Needs review » Fixed

Fixed in 2.0.x (commit f3512a1, release 2.0.1). MR !5 was not merged as is; the integration was rewritten to cover the problems it found:

Settings are read per editor, so there are no more lookups of the missing drupalSettings.ckeditor5Premium.mentions.marker.
The request now always sends the feed id.
The endpoint URL respects the site base path.
Results include text.
Search terms are no longer used as a regular expression.
Mentions now also store the feed and the mentioned entity (data-mention-feed, data-mention-entity-type, data-mention-entity-id). Thanks @drupatz for the analysis and @maris.abols for testing.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.