Kirby 3.8 and Virtual Pages

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!

See Update virtual pages guide, fixes #1884 by texnixe · Pull Request #1886 · getkirby/getkirby.com · GitHub

Thanks! However, when implementing this change i get an error Class “Uuid” not found and i can’t figure out why. Kirby Version is 3.8.2.

Btw.: i think there’s a typo in the PR in file

content/docs/1_guide/17_virtual-pages/1_simple-virtual-page/guide.txt

where UUID is written ‘allCaps’ in the source code.

Seems like the problem derived from a plugin. Now after updating Bnomei/Fingerprint and adding

use Kirby\Uuid\Uuid;

it does not throw the error anymore…my pages from the DB are still empty though…i’ll dive deeper…

Thanks for spotting…

For some reason Kirby keeps generating incomplete records in my DB. I try to persist the UUID in the DB as well, so maybe there’s a semantic error here?

'uuid' => is_null($project->kirby_uuid()) ? Uuid::generate() : $project->kirby_uuid(),

Does $project->uuid() really return null if the database field is empty?

i could not get it to work and at some point stumbled upon the "disable uuid’-option via this PR so i ended up just turning it off :disappointed:

thanks for your help!