-
-
Notifications
You must be signed in to change notification settings - Fork 184
Open
Copy link
Milestone
Description
I am using the following hook in my config.php to automatically set newly created pages (for specific templates) to listed:
use Kirby\Cms\Page;
return [
'hooks' => [
'page.create:after' => function (Page $page) {
$allowed = [
'news-item',
'stats-item',
'shop-item',
];
$template = $page->intendedTemplate()->name();
if (in_array($template, $allowed, true) === false) {
return;
}
if ($page->isDraft() === false) {
return;
}
$page->changeStatus('listed');
}
]
];The issue also occurs with this simplified version:
'hooks' => [
'page.create:after' => function ($page) {
$page->changeStatus('listed');
}
]Since updating to Kirby 5.3.0 (also reproducible in 5.3.1), the following issue occurs:
- When creating a new page in the Panel, the page is correctly set to listed.
- At the same time, an additional draft with the same slug is created.
- This extra draft contains only a
.txtfile with auuidfield — no other content. - The draft and the listed page have different UUIDs.
If I attempt to delete the draft in the Panel:
- The listed (original) page gets deleted instead.
- The draft remains.
- The remaining draft cannot be deleted anymore.
This behavior did not occur before version 5.3.0.
It appears that changing the status inside the page.create:after hook may interfere with draft handling or UUID generation in Kirby 5.3.x.
20260217-091708-ScreenShot.mp4
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels