Skip to content

[BUGFIX] Version prompt fragments in workspaces - #47

Merged
o-ba merged 7 commits into
mainfrom
bugfix/workspace-live-edit
Oct 28, 2026
Merged

o-ba merged 7 commits into
mainfrom
bugfix/workspace-live-edit

Conversation

@dgorges

@dgorges dgorges commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@dgorges
dgorges requested a review from o-ba October 27, 2026 06:23
@achimfritz

Copy link
Copy Markdown

i think versioningWS_alwaysAllowLiveEdit should set for TYPO3 < v14, so we need a TCA Override File for this case

@o-ba

o-ba commented Oct 27, 2026

Copy link
Copy Markdown
Member

Hey @dgorges, thank you! I pushed two follow-up commits.

  • PagePromptResolver now reads live records plus the ones created in the current workspace and drops hidden rows only after versionOL(). An assignment activated, deactivated or created in a workspace now resolves the way that workspace sees it. Deactivating one in a workspace didn't take effect at all before.

  • The auto-detected fragment upsert now reads live rows only (with an ORDER BY), so it can no longer pick up a workspace version and detach the live assignment's fragment.

  • PagePromptFragmentRepository now reads in the workspace of the current Context instead of live only. Per-page assignments, the auto-detected fragment, the counts, the page summary and the library usage see edits, activations, deletions, moves and new records. The JOINs are split because versionOL() can't overlay joined rows.

  • The paginated Pages/Library listings now works like the core Records module: search, sort and count run on live + new rows, the returned rows are overlaid.

Additionally, @achimfritz removing versioningWS_alwaysAllowLiveEdit means workspace versions of both tables now exist on 12.4, 13.4 and 14.0-14.3.7 too (core only strips the option from 14.3.8 on, so a "< v14" override would cover the wrong range and keep live edits by workspace-only editors).

@o-ba
o-ba force-pushed the bugfix/workspace-live-edit branch from 63b3c80 to 8bc95d3 Compare October 27, 2026 21:17
dgorges and others added 6 commits October 27, 2026 22:26
With versioningWS_alwaysAllowLiveEdit gone, workspace versions of
tx_aim_prompt_fragment and tx_aim_page_prompt_fragment exist on every
supported TYPO3 version.

PagePromptResolver now reads live records plus the ones created in the
current workspace and drops hidden rows only after the workspace
overlay, so an assignment activated, deactivated or created in a
workspace resolves the way that workspace sees it.

The assignment listing, the auto-detected fragment lookup, the
assignment counts and the aim:calibrateVoice upsert read live records
only, so they no longer return workspace versions or update one
directly.

Signed-off-by: Oliver Bartsch <bo@cedev.de>
PagePromptFragmentRepository read live records only, so the Prompt
Management module and PromptManagementApi hid what a backend user had
changed in their workspace.

Reads now follow the workspace of the current Context. Assignments,
the auto-detected fragment, the assignment counts, the page summary
and the library usage see edits, activations, deactivations, deletions,
moves and records created in that workspace. The paginated Pages and
Library listings filter, sort and count live records plus the ones
created in the workspace, like the core Records module, and overlay
the rows they return.

The auto-detected fragment upsert writes live without DataHandler and
keeps reading live records only.

Signed-off-by: Oliver Bartsch <bo@cedev.de>
The auto-detected fragment upsert counted only live assignments as
sharing the fragment. An assignment created or edited in a workspace
that reuses it was missed, so a re-run rewrote the fragment in place and
that page carried the new text unreviewed once published. Rows of every
workspace now count, except versions of the upserted assignment itself.

The Library listing selected move pointers next to their live rows, so a
fragment moved in a workspace was counted twice and could be counted
without being listed. It now reads live and new rows only and lets the
overlay apply the move.

PagePromptResolver sorted assignments before the workspace overlay, so a
reorder in a workspace did not change the composed prompt. It sorts the
overlaid rows now.

The upsert keeps writing live. Its docblock and the one of
PromptManagementApi::saveAutoDetectedFragment() say that a workspace
version of the fragment replaces that write once published.

Signed-off-by: Oliver Bartsch <bo@cedev.de>
upsertAutoDetectedFragment() writes live without DataHandler. With
both tables versioned, a call from within a workspace changed the
live tone of voice without review. It now throws there; the CLI runs
live and is unaffected.

When the upsert detaches the fragment, a pending workspace version of
the assignment that still points at the old fragment follows the
detach, so publishing it no longer points the live assignment back.

The Pages and Library listings leave out records deleted in the
workspace before counting and paginating, so totals match the rows
shown. countAllAssignments() counts in live and reads only the
columns it needs within a workspace.

Signed-off-by: Oliver Bartsch <bo@cedev.de>
The page filter of the Library listing read the assignments of the
current workspace without leaving out the ones deleted there, so a
fragment whose only assignment on the selected page was deleted in the
workspace was still listed and counted. excludeDeletedInWorkspace() now
uses integer literals, so it also applies to that subquery.

The docblocks and the changelog no longer claim that publishing a
workspace version of the fragment replaces what the upsert wrote after
it detached the assignment into a new fragment.

Signed-off-by: Oliver Bartsch <bo@cedev.de>
@o-ba
o-ba force-pushed the bugfix/workspace-live-edit branch from 8bc95d3 to 5bc6a89 Compare October 27, 2026 21:29
PagePromptFragmentRepository overlaid every row on its own with
versionOL(), one query per row, and sorted the result in PHP. It now
resolves the uids of a workspace through PlainDataResolver and reads
the resolved rows in one query, sorted in SQL, so a read costs the
same few queries however many rows it returns.

countAllAssignments() loaded the whole assignment table within a
workspace to count it. It counts in SQL now, each assignment once by
its version in that workspace, without the ones deleted there.

PagePromptResolver overlays with bypassEnableFieldsCheck, since it
checks hidden itself afterwards, which saves a query per row on 12.4
and 13.4.

A functional test now edits and deletes through DataHandler within a
workspace and checks that live stays untouched and that the Prompt
Management reads see the workspace only there. It replaces the unit
test that checked the TCA keys. PlainDataResolver resolves nothing and
DataHandler versions nothing without EXT:workspaces, so it is a dev
dependency now and part of the 12.4 and 13.4 CI legs.

Signed-off-by: Oliver Bartsch <bo@cedev.de>
@o-ba
o-ba merged commit 22846c4 into main Oct 28, 2026
13 checks passed
@o-ba
o-ba deleted the bugfix/workspace-live-edit branch October 28, 2026 08:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants