Content Versioning: Builder (M2A) drawer shows published values instead of the version's changes
Maintainers usually reply within 2 days
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 55/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- typescript
- Domain
- full-stack
Research direction
Start by tracing the Builder (M2A) drawer’s block loading and form initialization, then inspect how the parent version delta’s blocks.update[].item and blocks.create[] values are applied. Compare that flow with reopening a block from a saved version and check the related O2M issues for context. Done means reopening updated and newly added blocks in a version shows their saved values.
Written by the indexing model from the issue text.
Description
Describe the Bug
In a content version, reopening a Builder (M2A) item shows its published values instead of the changes saved in the version.
Saving the version works. The delta holds the change, and reading the parent with ?version=<key> returns it. The drawer form is the only place it goes missing. No request fails and the console stays clean, so editors think their changes were lost.
When the block is reopened, the app requests it directly with GET /items/block_trust_bar/<id>. That request has no version parameter, which makes sense because the version belongs to the parent. The app then doesn't apply the block's entry from the parent's delta (blocks.update[].item) to the form, while the block list on the parent does show the new title.
A block added inside a version opens with an empty form for the same reason: it exists only in the delta, so the drawer has no row to load. One of our editors hit this after adding a block to a draft and saving it. The form was empty when someone else opened it.
Possibly related: #27423 (O2M child in a version, closed) and #13537 (reopened nested O2M item reverts, closed before versioning existed).
To Reproduce
- Create a
pagescollection with content versioning enabled and a Builder (M2A) fieldblocks(junctionpage_blocks) that allows ablock_trust_barcollection with atitlefield. - Create a page with one
block_trust_barblock titled "Original title" and save it. - Create a version with key
drafton the page. - In the version, open the block, change the title to "Edited title", confirm the drawer and save the version. The block list now shows the new title.
- Open the block again.
Expected: the drawer shows "Edited title".
Actual: the drawer shows "Original title".
The version delta after step 4 (trimmed):
{
"blocks": {
"create": [],
"update": [
{
"id": "322b8487-9cd6-4e47-9646-8bb6f1764554",
"collection": "block_trust_bar",
"item": {
"id": "5702c0e5-f271-4f37-80a1-79719047be1b",
"title": "Edited title"
}
}
],
"delete": []
}
}
Read through the parent, the API returns the new value:
GET /items/pages/<page-id>?version=draft&fields=blocks.item:block_trust_bar.title
-> "Edited title"
The drawer's request returns the published value:
GET /items/block_trust_bar/5702c0e5-f271-4f37-80a1-79719047be1b
-> "Original title"
Directus Version
v12.6.0
Hosting Strategy
Self-Hosted (Docker Image)
Database
PostgreSQL 16 (postgis/postgis:16-master)
- Dominant language
- TypeScript
- Stars
- 38.8k
- Forks
- 5k
- Avg merge
- 4d 23h
- Merged PRs (30d)
- 72
Getting set up
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from directus/directus
-
Dragging the trigger arrow in flow.vue copies the full FlowRaw object into stagedFlow and bypasses hasEditsMay be free again A pull request for this issue was closed without being merged. OpenBug Flows Low Impact Low Reach Studio
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
directus/directus#28399 · 2 comments ·
Maintainers usually reply within 2 days
-
upstream
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
directus/directus#27190 · 3 comments ·
Maintainers usually reply within 2 days
-
Environment Sync: push/diff fails with RECORD_NOT_UNIQUE on directus_operations.resolve when a flow's operation chain is rewiredPossibly taken @psang39 claimed this today. Open
Difficulty 4/5 3-5 days Newbie friendliness 52/100
directus/directus#28520 · 1 comment ·
Maintainers usually reply within 2 days
-
Concurrent session refresh creates duplicate sessions on MySQL/MariaDBPossibly taken @alexey-yarmosh claimed this 27 days ago. Open
Difficulty 3/5 1-2 days Newbie friendliness 25/100
directus/directus#28492 · 1 comment ·
Maintainers usually reply within 2 days
-
High Reach Improvement Med Impact Needs Product Discussion Studio UX / DX
Difficulty 4/5 3-5 days Newbie friendliness 45/100
directus/directus#28471 · 2 comments ·
Maintainers usually reply within 2 days
All issues in directus/directus
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
ranxianglei/billion-context#7597 ·
Maintainers usually reply within 1 day
-
kubernetes-ingestor: fetchCRDMapping() runs even when crossplane.enabled is false, logging a 403 ERROR every runPossibly taken @kc9ddi claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
TeraSky-OSS/backstage-plugins#228 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
zmkfirmware/zmk#3571 ·
Maintainers usually reply within 10 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
[Windows] Hidden title bar: a maximized window restored from minimized on a secondary monitor gets the primary monitor's work area as its client areaPossibly taken @lijy91 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
libnativeapi/nativeapi#53 · 1 reaction ·
Maintainers usually reply within 1 day