Skip to content

fedms_attachment

Owns the fedms_attachment content entity — a wrapper around media and webforms that can carry its own task patterns.

GitLab

fedms/components/attachments

What it ships

Content entity type

Entity type Purpose
fedms_attachment Wraps a media item / webform / file with metadata, assignees, visibility, and task patterns.

Revisionable, owner-aware, bundle-driven. The bundle is fedms_attachment_type. Out of the box one bundle ships: default.

Base fields (on Attachment::baseFieldDefinitions)

Field Type Purpose
label string Display name.
status boolean Active flag.
uid entity_reference (user) Owner.
created, changed created / changed Timestamps.
description entity_reference_revisions (paragraph) Body content using the same 4 paragraph types as events/sessions.
group entity_reference (group, bundles event + session) The event or session the attachment belongs to.
assignee entity_reference (user, unlimited) Users responsible for the attachment.
visibility list_string private / group / public.
fedms_task_patterns list_string (unlimited) Task patterns to spawn from this attachment.

The default attachment type also ships a field_video field used by the Attachment Recording recipe.

Entity class

src/Entity/Attachment.php@ContentEntityType(id = "fedms_attachment").

Forms

  • AttachmentForm — create/edit attachments.
  • AttachmentTypeForm — manage attachment types.

Why a separate entity?

Attachments could be modelled as Media entities directly, but FedMS adds value by wrapping them:

  • An attachment carries its own task patterns, so adding the attachment to an event automatically spawns tasks.
  • An attachment carries assignees and visibility, which media doesn't have natively.
  • An attachment can wrap multiple artifacts (a recording + a transcript + a slide deck), each linked through paragraph children.

Module dependencies

1
2
3
4
5
- drupal:media
- drupal:text
- fedms_content:fedms_content
- field_group:field_group
- paragraphs:paragraphs

fedms_content is a dependency because attachments share the paragraph-based description architecture.

When to change this module

  • Adding base fields to fedms_attachment.
  • Changing how the visibility filter is enforced.
  • Adding workflow-specific attachment behavior shared across all attachment types.

When not to change this module

  • Adding tenant-specific attachment types — those are config exported per-tenant.
  • Adding task-pattern resolution logic — that's fedms_task.

Next steps