We have build a site with virtual pages in a database following the recipe.
While trying to upgrade to 3.8 we ran into a problem related to the UUIDs:
On first request Kirby is doing something that causes the creation of duplicates in our database, i assume it’s some ->writeContent() call related to adding UUIDs but i could not figure out why and what is happening.
I assume i also have to add UUIDs at the point where i recreate the model based on my DB-values (excerpt from the cookbook below), but how an where?
class CommentsPage extends Kirby\Cms\Page
{
public function children()
{
$comments = [];
foreach (Db::select('comments') as $comment) {
$comments[] = [
'slug' => $comment->slug(),
'num' => 0,
'template' => 'comment',
'model' => 'comment',
'content' => [
'text' => $comment->text(),
'user' => $comment->user(),
]
];
}
return Pages::factory($comments, $this);
}
}
Thanks for helping out!