Skip to content

group_operations ECA model

Source: eca.eca.group_operations.yml

Purpose: Wires up per-group operations — what shows in the group's operations menu / VBO actions, what tokens are available in those flows, and a couple of pre-save guarantees on event/session entities.

Events the model listens to

Plugin Label
content_entity:presave Pre-save event
content_entity:presave Pre-save session
eca_base:eca_token_generate Group context tokens

Entities & contexts touched

  • group (bundles event, session)
  • ECA token registry (custom eca_base:eca_token_generate)

Why it exists

  • Pre-save hooks ensure that when an event or session group is saved, derived state (e.g. field_flag_*_processed defaults, generated label parts) is consistent before persistence.
  • Token generation exposes the current group context to other ECA models so they can render labels, conditions, and links without duplicating context resolution.

Editing notes / gotchas

  • Pre-save logic runs on every save — keep conditions tight, otherwise you pay a performance tax on bulk imports.
  • Tokens defined here are consumed by links, group_blocks, milestone_views, and the task_api task labels. Renaming a token breaks downstream models silently — search before renaming.
  • Don't perform writes in pre-save handlers that trigger more save events — you'll create infinite loops.

See also

  • ECA guide — how token generation works.
  • links — the most prolific consumer of these tokens.
  • task_api — uses these tokens for task labels.