Open hariom147 opened 1 year ago
You are guessing this problem. Uuid processes start before the page is created (via form class, mentioned below related lines) and the non-existent page is saved with ModelUuid::storeId()
. When it's time for the actual page creation, the error returns because the page has already created.
https://github.com/getkirby/kirby/blob/3.8.3/src/Cms/PageActions.php#L539-L543 https://github.com/getkirby/kirby/blob/3.8.3/src/Uuid/ModelUuid.php#L121
Also this is working on 3.8.0 but not for 3.8.1.1, 3.8.2 and 3.8.3. ~So it's regression.~ Because we have added UUIDs for multilanguage in 3.8.1.1. So this should be bug instead regression.
It's unfortunately a lot more complex than we hoped, but there's a simple workaround for now:
info:
type: info
text: "{{ page.content.get('uuid') }}"
We are working on getting this fixed permanently in one of the next major versions.
The same issue happens with {{ page.permalink }}
, is there maybe a workaround for that too?
@mynameisfreedom As workaround you can use like that:
{{ kirby.url('base') }}/@/page/{{ page.content.get('uuid') }}
Also you use custom page methods: {{ page.myCustomPermalink }}
that use $page->content()->get('uuid')
instead $page->uuid()
.
You are a Kirby beast @afbora 💪
Thank you, that works 🚀
Description
When adding
{{ page.uuid }}
to a blueprint (anywhere, i.e. in thetext
property of theinfo
field or thehelp
property of any field I tried), the add page dialog throws a duplicate error, even though the page slug does not exist. The page is created nonetheless: After cancelling the dialog and refreshing the panel the created page shows. Only happens when'languages'=> true
is set in config.Expected behavior
Add a new page through pages section in the panel without error.
Screenshots
To reproduce
install fresh starterkit
enable languages in config
add
page.uuid
to page blueprint i.e.From pages section create a new page that has
page.uuid
in its blueprintSee error
Your setup
Kirby Version
3.8.3
Console output
XHRPOSThttp://starterkit.test/panel/dialogs/pages/create?language=en [HTTP/1.1 400 Bad Request 29ms]
POST http://starterkit.test/panel/dialogs/pages/create?language=en Status 400 Bad Request VersionHTTP/1.1 Übertragen406 B (145 B Größe) Referrer Policysame-origin Anfrage-PrioritätHighest
Your system (please complete the following information)