luca
December 14, 2022, 9:50pm
1
When a call to page.uuid
is present in a blueprint and a new draft of this specific blueprint is created in the panel, it shows
Error: A page draft with the URL appendix "..." already exists.
But the page is created anyway and shows up in the pages section when refreshing the panel after cancelling the dialog.
I tried a fresh starterkit, but everything works as expected there.
Then I tried to narrow down where the error comes from:
disabling all plugins
removing all page models
creating a page method with a Uuid and an appendix and calling it instead of page.uuid
in the template
Nothing worked. The error persists and I donāt know where to look further.
I am grateful for any ideas, what I could try next.
texnixe
December 14, 2022, 10:00pm
2
Please post the blueprint with this method
And which Kirby version are you using?
luca
December 14, 2022, 10:03pm
3
sections:
fields1:
type: fields
fields:
test:
type: info
text: "{{ page.uuid }}"
Iām using Kirby 3.8.3.
luca
December 15, 2022, 3:05pm
4
Strange thing is, it seems to be enough that the page.uuid
(or also page.uuid.id
) is present anywhere in the blueprint ā i.e. in an info field, in the help:
prop of any other field and even as a data argument in Bnomeiās Janitor Plugin:
button_copy_id:
type: janitor
command: 'janitor:clipboard --data {{ page.uuid.id }}'
label: 'Copy Page ID to Clipboard'
progress: Copied!
icon: copy
texnixe
December 15, 2022, 4:12pm
5
I could reproduce the problem in my not so fresh Starterkit, just surprised that you couldnāt. Need to test later tonight in a fresh kit.
To me, that smells like a bug.
luca
December 15, 2022, 4:38pm
6
Thanks for checking. It is not urgent to me, just kept bugging meā¦
luca
December 16, 2022, 4:54am
7
Hi @texnixe
the error didnāt show in my starterkit because I forgot to set
`languages' => true
in the config, as in my main project.
If set, the error shows in a fresh starterkit.
As I now know how to reproduce the error, would it be of help if I filed an issue on github?
texnixe
December 16, 2022, 8:43am
8
Yes, please. My Starterkit is multilang as well-
1 Like
mrx234
October 26, 2023, 8:33pm
9
Hi, I encounter the same error but I do not use page.uuid
in the bleuprint affected! If this has been solved meanwhile, it would be great to have the solution posted here.
@luca Did you file the issue and where can I find it?
Thanx a lot!
texnixe
October 26, 2023, 8:49pm
10
opened 12:57PM - 16 Dec 22 UTC
type: bug š
## Description
When adding `{{ page.uuid }}` to a blueprint (anywhere, i.e. in ⦠the `text` property of the `info` field or the `help` 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**
<img width="442" alt="BildschirmĀfoto 2022-12-14 um 22 37 25" src="https://user-images.githubusercontent.com/8297800/208088215-bff3bdbc-27b4-4aa8-b459-b9dc769305b7.png">
## To reproduce
1. install fresh starterkit
2. enable languages in config
3. add `page.uuid` to page blueprint
i.e.
```
fields:
test:
type: info
text: "{{ page.uuid }}"
```
4. From pages section create a new page that has `page.uuid` in its blueprint
5. See 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
Cache-Control
no-store, private
Connection
keep-alive
Content-Type
application/json; charset=UTF-8
Date
Fri, 16 Dec 2022 12:47:36 GMT
Server
nginx/1.23.2
Transfer-Encoding
chunked
X-Fiber
true
X-Powered-By
PHP/8.1.13
Accept
*/*
Accept-Encoding
gzip, deflate
Accept-Language
de,en-US;q=0.7,en;q=0.3
Cache-Control
no-cache
Connection
keep-alive
Content-Length
72
Content-Type
text/plain;charset=UTF-8
Cookie
kirby_session=ecafab31991a13734302b2895694415ef3aa09de%2B1672404442.c7760f7f8bf57b3fafc0.f3521b151bc46c42e64d821b8633be831483e8bff171a3caa8e34ab2d2006771
Host
starterkit.test
Origin
http://starterkit.test
Pragma
no-cache
Referer
http://starterkit.test/panel/site
User-Agent
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:107.0) Gecko/20100101 Firefox/107.0
X-CSRF
f5784bc2719486f3b79492777f5ba0dffde7c975c0b2ef48ca0d8aa991446ba9
X-Fiber
true
X-Fiber-Globals
false
X-Fiber-Only
X-Fiber-Referrer
/site
**Your system (please complete the following information)**
- Device: MacBook Pro, 16 inch 2019
- OS: MacOS 13.0.1
- Browser: all
There is a workaround suggested in the issue as well
luca
October 26, 2023, 8:50pm
11
you just beat me to the answer, @texnixe
2 Likes
mrx234
October 27, 2023, 11:57am
12
Thank you @texnixe for the link! Meanwhile I analyzed my code and found the page.uuid
causing the error in one of my custom models (instead of the blueprint ā¦) where I take the UUID of the page to find out if there are any other pages refering to it (which of course do not with a page currently being created!):
$uuid = $this->uuid()->toString();
Changed it according to @bastianallgeier ās suggestion in the issue mentioned above to:
$uuid = (string) $this->content()->get('uuid');
Works!