fix: tb-assign reattaches only templates no Theme Builder post lists (audit L4)

"Detached" now means for lit/tb-assign what lit/tb-list shows as detached:
DiviThemeBuilder::isListedAnywhere() looks for any _et_template row (live,
draft or Theme Builder library post). A template another Theme Builder post
lists is refused with or without reattach; nothing is written.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01At3V6SjwbMe6eMzVGW3Hs7
This commit is contained in:
2026-09-27 23:06:35 +02:00
co-authored by Claude Opus 5.5
parent dcae2d4b91
commit e64d32b1f1
6 changed files with 95 additions and 3 deletions
+3
View File
@@ -128,6 +128,9 @@ final class ThemeBuilderFixtures
$store->allows('templateIds')->andReturn(array_map(static fn (Template $t): int => $t->id, $templates));
$store->allows('template')->andReturnUsing(static fn (int $id): ?Template => $byId[$id] ?? null)->byDefault();
$store->allows('detachedIds')->andReturn(array_map(static fn (Template $t): int => $t->id, $detached));
$store->allows('isListedAnywhere')->andReturnUsing(
static fn (int $id): bool => in_array($id, array_map(static fn (Template $t): int => $t->id, $templates), true)
)->byDefault();
$store->allows('flatConditions')->andReturn(self::conditions());
return $store;