fix: content-create with divi returns the Visual Builder edit_url (review I-1)

DiviPage::builderUrl() is shared by DiviPage::editUrl() and the content
composer, which now returns edit_url; content-create without divi keeps
the wp-admin link. divi-write-smoke checks the builder URL and, new in
section 9, the M1/M2 gates live (raw Divi markup refused; Divi read-only
stops content-create divi and execute-ability lit/divi-insert).

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-26 19:19:04 +02:00
co-authored by Claude Opus 5.5
parent 5f596b8a17
commit 4fe0810049
7 changed files with 74 additions and 9 deletions
@@ -77,9 +77,14 @@ final class DiviContentComposerTest extends TestCase
public function testWritesAPlaceholderWrappedLayoutBoundToTheNewEntry(): void
{
\Brain\Monkey\Functions\when('get_permalink')->justReturn('https://kunde.test/?page_id=42');
\Brain\Monkey\Functions\when('add_query_arg')->alias(
static fn (string $key, string $value, string $url): string => $url . '&' . $key . '=' . $value
);
$written = $this->composer()->write(42, 'page', self::sections());
self::assertIsArray($written);
self::assertSame('https://kunde.test/?page_id=42&et_fb=1', $written['edit_url'], 'review I-1: builder URL');
self::assertSame([42], $this->registryCalls, 'the final layout uses the live map of the new entry');
$content = $this->saved[42];
// Ruling S9: exactly one divi/placeholder around the sections, as TreeEditor does for empty pages.