-
-
Notifications
You must be signed in to change notification settings - Fork 168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Same Uuid is re-used every time when creating a child page #6640
Comments
I can reproduce the issue with the steps you've outlined. The |
Thanks for looking into this @distantnative. I'm quite confident that a page with the slug |
But isn't that your use case you outlined in the top post to reproduce this issue? The temporary page https://github.com/getkirby/kirby/blob/main/src/Panel/PageCreateDialog.php#L251 should not be saved (and thus not create a new folder in the filesystem). But as currently our virtual pages are not properly restricted to in-memory, I assume if there already exists a page with the same slug, it will very willingly read the content file (and thus pick up the existing UUID). |
Yes but only for the reproduction with the plain kit. On the server where this issue was noticed, the child page with the I will check a migration script, used to re-sort child-pages, that was run in the past, if it could be responsible for the |
After deleting the page with the I noticed the same behaviour on another page. Still not sure what’s causing this but it was not the migration script or problems with oom-kill. Not sure if the problems are related, so can create a another issue. Let me know. |
Probably related and definitely important to catch the bug - at least it sounds like a bug in Kirby. We just need to figure out what brings out the bug. Do you have any page hooks set up? |
For the most recent site i’m using two hooks in my config file. Both sites share routes being registered from 'hooks' => [
'system.loadPlugins:after' => function () {
kirby()->extend([
'routes' => include __DIR__ . '/config.routes.php'
]);
/**
* Register PHP Blueprints from Kirbys Blueprints directory
*/
kirby()->extend([
'blueprints' => Blueprints::loadPhpBlueprints()
]);
}
], # config.routes.php
return (function (): array {
$merchantsPage = kirby()->page('markt');
$merchantCategoriesPage = $merchantsPage->children()->findBy('intendedTemplate', 'merchant-categories');
return [
[
'pattern' => "(:any)",
'language' => '*',
'page' => $merchantCategoriesPage->id(),
'action' => function (string $language, Page $page, $category) use ($merchantsPage) {
$categoryPage = $page->children()->findBy('slug', $category);
// Return 404 when category page is not found
if (!$categoryPage) {
return false;
}
return $merchantsPage->render([
'category' => $categoryPage
]);
}
],
];
})(); Plus hooks added by tobimoris DreamForm, thumbhash and SEO plugins. I can rule out the DreamForm plugin because it was added to the site after the return [
'page.update:after' => function (Page $newPage, Page $oldPage) {
foreach ($newPage->kirby()->option('tobimori.seo.robots.types') as $robots) {
$upper = Str::ucfirst($robots);
if ($newPage->content()->get("robots{$upper}")->value() === "") {
$newPage = $newPage->update([
"robots{$upper}" => 'default'
]);
}
}
},
'page.render:before' => function (string $contentType, array $data, Page $page) {
if (option('tobimori.seo.generateSchema')) {
$page->schema('WebSite')
->url($page->metadata()->canonicalUrl())
->copyrightYear(date('Y'))
->description($page->metadata()->metaDescription())
->name($page->metadata()->metaTitle())
->headline($page->metadata()->title());
}
},
]; |
Some more information regarding the issue. Two post above i was talking about two pages where the issue re-appeared, which is unclear, i was referring to two different Kirby installations.
|
More observations from today : )
Deleting the uuid cache folder and populating it does not make a difference. I’ve checked via script that there are no duplicate UUIDs before testing with the steps above. Connecting x-debug with a breakpoint at https://github.com/getkirby/kirby/blob/main/src/Panel/PageCreateDialog.php#L251 The first request is happening when the Page Create Dialog is opened, the one where Kirby asks for the page title. |
@ovenum Thanks that you keep posting your observations. I haven't had the chance to reproduce this myself but all this contextual information will surely help. |
No problem. This is not meant to pressure you. It’s more thinking aloud or a mini journal documenting the observations. |
@ovenum Can you share a copy of your app here or via [email protected] so we can test where the temporary page actually created in content folder? |
@afbora that could be difficult, the complete installation is around 22GB in size (lots of images) and includes forms with privacy relevant data which i would have to remove prior. I have time today to take a closer look at this issue again and can share stack traces leading up to the creation of the |
@afbora could create a reproducible example repo based on the plainkit. https://github.com/ovenum/kirby-uuid-issue-reproducible
Expected Behavior update
Observations The custom field value prop: The page model function that’s called by the custom field Sorry code embeds don’t seem to work for me(?) |
Thank you @ovenum I had discussed this issue with @distantnative before. I said that the issue was related to calling Regarding the solution, I'm not sure about a permanent solution but as a temporary solution I would suggest the following usage instead of // workaround solution for the uuid issue
$this->content()->get('uuid')->value(); |
Can confirm that reading the uuid from the content file instead of calling For people reading this keep in mind that when reading the UUID from the content file, it will not have the UUID scheme (page://, file://) prepended. |
Description
When a parent page contains a child page with slug new Kirby will re-use that child pages Uuid when a new child page is created.
Expected behavior
The Uuid to be unique : )
To reproduce
Using a fresh plainkit installation:
They are the same
Note
When the Uuid of the draft child page created via the panel is deleted manually, Kirby will correctly assign a new, truly unique Uuid to that page when it’s requested by the panel.
Your setup
Kirby Version
4.3.0
The text was updated successfully, but these errors were encountered: