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([]);
}
Issue fork ckeditor5_mentions-3553526
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
Comment #3
drupatz commentedComment #4
drupatz commentedComment #5
drupatz commentedThere is a bug in this mr. The selected text is cut off after 7 characters
Comment #6
drupatz commentedComment #7
drupatz commentedComment #8
maris.abols commentedRun into same problem that in Drupal 11 plugin is just not working, no errors no nothing. Changes above worked for me!
Comment #9
sujan shrestha commentedFixed 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.