fix: Texte zu post_ids und Bearbeitungsrecht nennen forbidden für genannte Live-Seiten; Test für genannte blockierte Live-Seite; Smoke prüft Seiten-IDs numerisch

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Jan-Niclas Loosen
2026-10-18 17:28:19 +02:00
co-authored by Claude Sonnet 5.5
parent 10bed73b24
commit 6b5de199f9
6 changed files with 40 additions and 9 deletions
@@ -120,7 +120,7 @@ tree_rev() { # $1 = post ID
# 1. Two draft pages with one button without preset each.
PAGE1=$(create_page "$PREFIX Seite 1")
PAGE2=$(create_page "$PREFIX Seite 2")
[ -n "$PAGE1" ] && [ -n "$PAGE2" ] || fail "pages not created"
[[ $PAGE1 =~ ^[1-9][0-9]*$ && $PAGE2 =~ ^[1-9][0-9]*$ ]] || fail "pages not created"
for id in "$PAGE1" "$PAGE2"; do
button_attrs "$id" | jq -e '(.modulePreset // null) == null and (.groupPreset // null) == null' >/dev/null \
|| fail "page $id starts with a preset"
@@ -268,6 +268,29 @@ final class PageRewriterTest extends TestCase
self::assertSame([[101, SaveScope::Page]], $this->saved);
}
/** A named live post the caller may not edit blocks the whole call (forbidden), also with post_ids. */
public function testNamedBlockedLivePageRefusesTheCallEvenWithPostIds(): void
{
$rewriter = $this->rewriter(
[
self::page(101, self::layout(self::BUTTON), ['post_status' => 'publish']),
self::page(102, self::layout(self::BUTTON), ['post_status' => 'publish']),
],
self::report(2, [102], 2)
);
$preview = $rewriter->preview(self::query(), self::assign(), [101, 102]);
self::assertSame([102], $preview['blocked_ids']);
$error = self::assertToolError(
$rewriter->apply(self::ABILITY, self::query(), self::assign(), [101, 102], self::SUMMARY),
'forbidden'
);
self::assertSame([102], $error['blocked_ids']);
self::assertSame([], $this->saved);
self::assertSame([], $this->log->records);
}
public function testTooManyLiveUsagesAreUnsupported(): void
{
$rewriter = $this->rewriter(