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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user