Hi! I’m encountering a bug on a live client site where multiple different pages have apparently been assigned identical UUIDs, which leads to pages fields not working properly. Is this a known bug? Do you have any idea what might have been the cause of this error and what steps I can take to fix it?
The site has been running on Kirby 4.6.1. I’m now updating to the most recent version. As a quick fix I’m temporarily changing the pages field to store IDs instead of UUIDs.
All the best!
Edit: even with stored IDs the pages field seems to get confused and stores the ID of the wrong page.
Can you reproduce the issue in a Starterkit of the same Kirby version? Could it be that those duplicated UUID were created through page duplication? As far as I recall, that used to be an issue but not exactly sure which update fixed that, guess that was long before 4.6
Had same issue when on 4.4.1. Also some weird folders called “new” popping up when drafts where created.
The steps I took was
I had to update a custom custom plugin which made use of the uuid in a property. Might not apply to you but do a search for uuid in blueprints and plugins.
I changed this line: return $this->model()->uuid()->id();
To this return $this->model()->content()->get("uuid")->value();
update to 4.7
Clean the cache, including the uuid cache! On the live server I had to do that by ssh as ftp didn’t handle the big number of files very well
Finally you can force Kirby to regenerate the uuid cache in one go, there’s a method for that which I can’t recall at the moment
This script might help to identify duplicates and verify you don’t have any left after the remedy. Put it in a template. It’s originally based on something I found on this forum, should credit someone but it was a while ago so I don’t know who.
Interesting, thanks a lot for the hint. I’ve had the __new__ issue as well.
I’m actually using slug: "{{ site.time }}-{{page.title.slug}}" in a custom page creation dialog, but displaying the page’s UUID with text: "{{ page.permalink }}" in a text field in the sidebar. I’ll remove that field for now.
Thank you for this! Turns out there’s way more same UUIDs than I thought. I’ll clean the cache and regenerate UUIDs. The method is Uuids::generate('pages') (see Regenerate page uuids - #2 by texnixe)
Meanwhile I’ve upgraded Kirby to the latest version and removed the field where the UUID is shown to the user. Let’s see if the issue persists.