Skip to content

users ECA model

Source: eca.eca.users.yml

Purpose: User automations — login behavior, default fields on user forms, pre-save guarantees, post-update reactions.

Events the model listens to

Plugin Label
user:login User login
content_entity:prepareform Prepare user for form
content_entity:presave Presave user
form:form_build Build user form
content_entity:update Update User

Entities & contexts touched

  • user
  • The user's group memberships (read-only in most branches)

Why it exists

  • Login triggers landing-page routing decisions and may flip lifecycle flags on the user record.
  • Prepare/build form injects FedMS-specific defaults — language, name fields, telephony format, profile image fallbacks.
  • Pre-save enforces consistency (e.g. lower-case email, populate field_name parts when the user supplied only a display name).
  • Update handles cascading effects of role changes — these often cascade into the task_api model via membership re-evaluation.

Editing notes / gotchas

  • The user form is shared across the admin UI, the registration form, and the masquerade flow. Test all three after edits.
  • Login redirects often interact with gin_login and login_emailusername configuration. If a redirect breaks, check whether the change belongs here or in those modules' rewrites (see fedms profile's rewrite: list).
  • Don't perform expensive operations on every login — caches, network calls, etc. should be deferred or queued.

See also

  • task_api — consumes role / membership changes that originate here.
  • fedms profile fedms.info.yml — declares the field_* storage on users that this model populates.