Views and extending
Views
Views data: Drupal\moderation_note\ModerationNoteViewsData (src/ModerationNoteViewsData.php).
- Base table:
moderation_note(provider: moderation_note; base field: id). - Relationship: “Notated content” — relates
entity_id+entity_langcodetonode_field_data(nid, langcode). Other entity types can be added similarly. - Field: “Link to note” — plugin
moderation_note_link(ModerationNoteLink), links to the note in context. - Filters:
parentallows empty;uidandassigneeuseuser_namefilter.
Use Views to list notes, filter by author/assignee/entity, and expose “Link to note”.
Extending
- Entity: Implement or extend
ModerationNoteInterfacefor custom logic; entity class isModerationNote. - Templates: Override
moderation_note.html.twig,moderation_note--preview.html.twig, ormail-moderation-note.html.twigin a theme. - Hooks: Implement
hook_entity_delete,hook_mail, etc., or alter data in existing hooks (see Hooks and events). - Access: Access is in
AccessControlHandler; no separate events for note access. Entity hooks (e.g. insert/update) run after save. - Menu count: Replace or decorate
moderation_note.menu_countservice if you need different “View notes” or “Assigned notes” behavior.
Multilingual
Each note stores entity_langcode. Notes are scoped to the language of the field being notated, so the same content in different languages can have separate note threads.