Problem/Motivation
In my case, i would like to send a notification via eca module. Therefore it would be nice to have an event, which eca could grab and react. I think, it would be a nice feature for other use cases, too. This event should fire, when the entity carrying the ckeditor field is saved and a mention is placed.
So i'll provide this event here.
But: there are several places in this module, where the code is simply incomplete. Like the MentionsHelper, which returns hardcoded values instead of the configured ones.
I'll fix everything in this branch, hopefully satisfying the maintainer.
Issue fork ckeditor5_mentions-3553744
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
sujan shrestha commentedFixed in 2.0.x (commit f3512a1, release 2.0.1). After a content entity with mentions in its text fields is saved, the ckeditor5_mentions.entity_saved event (\Drupal\ckeditor5_mentions\Event\MentionedEntityEvent::NAME) is dispatched. It provides:
getEntity()
isNew()
getMentions() and getNewMentions() (only the mentions added by this save), filterable by feed and field
getMentionedEntities()
Older mention markup is resolved by label. The README has a subscriber example. This is implemented differently from MR !6 (one event per save rather than per field/feed). Thanks @drupatz.