I have a weird bug that appears with Kirby 3.8.2 when the UUID generation is not disabled.
It happens when I try to create a page programmatically. Kirby creates the page but throws an exception:
"Kirby \ Exception \ DuplicateException (error.page.draft.duplicate)"
.../kirby/src/Cms/PageRules.php269
The draft page created has only the uuid wrote in the txt file not the title.
My website is multilingual (I don’t know if this influences the bug)
What’s weird is that it only happens with one of my templates, not the others.
The bug happens with this simple code:
$kirby->impersonate('kirby');
$data = [
'title' => 'My title',
];
$kirby->site()->createChild([
'content' => $data,
'slug' => Str::slug( $data['title'] ),
'template' => 'adventurer',
]);
If I change 'template' => 'adventurer',
by another template, it works! (uuid enabled)
If I keep 'template' => 'adventurer',
but disable UUID, it works! (whatever Kirby version)
If I keep 'template' => 'adventurer',
and use a Kirby version < 3.8.2, it works! (uuid enabled)
So it may have something to do with a change in the UUID handling in Kirby 3.8.2. But what I don’t understand is why this bug only occurs when I create a page with one type of template and not the others?