Skip to content

Commit 01183a2

Browse files
authored
2 parents a34550d + 77f5a9f commit 01183a2

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

index.php

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,24 @@
3939
'command' => function ($command = null) {
4040
// resolve queries
4141
$command = \Bnomei\Janitor::query($command, $this->model());
42+
43+
// Temporary fix for https://github.com/getkirby/kirby/issues/4955
44+
$uuid = $this->model()->content()->uuid()?->toString();
45+
4246
// append model
4347
if ($this->model() instanceof \Kirby\Cms\Page) {
44-
$command .= ' --page ' . $this->model()->uuid()?->toString() ?? $this->model()->id();
48+
$uuid = !empty($uuid) ? 'page://'. $uuid : null;
49+
$command .= ' --page ' . $uuid ?? $this->model()->id();
4550
} elseif ($this->model() instanceof \Kirby\Cms\File) {
46-
$command .= ' --file ' . $this->model()->uuid()?->toString() ?? $this->model()->id();
51+
$uuid = !empty($uuid) ? 'file://'. $uuid : null;
52+
$command .= ' --file ' . $uuid ?? $this->model()->id();
4753
} elseif ($this->model() instanceof \Kirby\Cms\User) {
48-
$command .= ' --user ' . $this->model()->uuid()?->toString() ?? $this->model()->id();
54+
$uuid = !empty($uuid) ? 'user://'. $uuid : null;
55+
$command .= ' --user ' . $uuid ?? $this->model()->id();
4956
} elseif ($this->model() instanceof \Kirby\Cms\Site) {
5057
$command .= ' --site'; // boolean argument
5158
}
52-
$command .= ' --model '. $this->model()->uuid()?->toString() ??
59+
$command .= ' --model '. $uuid ??
5360
($this->model() instanceof \Kirby\Cms\Site ? 'site://' : $this->model()->id());
5461

5562
$command .= ' --quiet'; // no STDOUT on frontend PHP

0 commit comments

Comments
 (0)