ADR-212: A generic file attacher, only where no narrow writer exists
- Status
-
Accepted
- Date
-
2026-10-06
- Authors
-
Netresearch DTT GmbH
Context
A live editorial run on the Netresearch demo (NEXT-199) created a news draft
with create_ and could not give it its image: "the image was not
attached". ADR-197 lets the assistant create a record in a
table no narrow writer covers, and it cannot set a file field by design (a
relation is not a scalar column). attach_ references
an existing file from a content element and from nothing else.
The same position as in ADR-197 applies: an extension that wants its records written brings its own writer, and a writer for the file field of one extension is reviewed where that extension's TCA is known. Until it exists, every extension table with a file field has the gap this record closes.
Decision
`attach_` from one file field of one
record. It is the sibling of attach_ and keeps its
terms (ADR-135, ADR-146, ADR-180):
- One datamap. One
sys_through the DataHandler as the acting backend user, in the live workspace, with the new reference's placeholder in the parent list, so the record's counter and the reference's position come out right in one pass. The read-back asserts row, counter, position and every text, and a failed read-back deletes the reference and writes the parent list back.file_ reference - No upload, move or rename. The file must already exist in a storage the
Falallows and inside the acting user's file mounts.Storage Gate - The record may be hidden. That is the draft the assistant has just
created; the tool never changes
hidden. - The acting user's rights, before the write.
tables_on the table, content edit on the record's page, the field-level grant for the file field (the DataHandler would drop it in silence), and the neutral refusal "Record or file not found, or not permitted." for an absent record, an unreachable file and a page the user may not edit alike.modify - Tables by exclusion.
pagesandtt_are refused by name and point tocontent set_andpage_ social_ image attach_;file_ to_ content_ element sys_*tables, the read-side denylist and a table declaredadmin,Only hideorTable readare out.Only - A file field of the table, and an extension it accepts. The field must be
a
type => filecolumn;allowedanddisallowedof that column (with the threecommon-*aliases resolved, and as narrowed by the record type'scolumns) are applied to the file. OmittingOverrides fieldis accepted only where the table has exactly one. - Default language only, as the sibling does.
- Disabled by default, in the
editinggroup, a non-idempotent write.
Copyright is not a column of sys_: it is a property of the
file (sys_, EXT:filemetadata) and is written by
update_. This tool sets what belongs to the reference — title,
alternative text, description — which override the file's for this one place.
Whether an attached image becomes the record's social image is the
extension's rule. EXT:news prints the first reference with showinpreview,
and otherwise the first of fal_, as og:.
Consequences
- The assistant can complete a news article from one conversation: draft
(
create_), image (this tool,news_ draft fal_), the image's metadata (media update_), and read the draft back (fal_ asset_ meta read_withrecords include_).hidden - The tool has no editor action: an editor action is offered on a record of one table (ADR-152), and this tool has no such subject. It is reached through the assistant only.
- A table whose installation excludes it from
create_is not excluded here; the exclusion list of ADR-197 is a creation rule.record_ draft
Revisit when
- EXT:news, or a bridge on its behalf, ships its own writer for
fal_: this tool then steps back for that table, the waymedia create_does for a table another registered tool creates records in.record_ draft - A
showinpreviewargument is wanted. Its TCA type depends on the news settingadvanced(a checkbox, or a select of three values), so the argument and its read-back have to follow whichever is installed.Media Preview