Skip to content

Commit

Permalink
🚑 model resolver not working for non uuid setups
Browse files Browse the repository at this point in the history
Signed-off-by: bnomei <[email protected]>
  • Loading branch information
bnomei committed May 26, 2023
1 parent 5e7954f commit 87ed4d8
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "bnomei/kirby3-janitor",
"type": "kirby-plugin",
"version": "3.10.0",
"version": "3.10.1",
"license": "MIT",
"homepage": "https://github.com/bnomei/kirby3-janitor",
"description": "Kirby 3 Plugin for running commands like cleaning the cache from within the Panel, PHP code or a cronjob",
Expand Down
11 changes: 6 additions & 5 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,18 +65,19 @@
// append model
if ($this->model() instanceof Page) {
$uuid = !empty($uuid) ? 'page://' . $uuid : null;
$command .= ' --page ' . $uuid ?? $this->model()->id();
$command .= ' --page ' . ($uuid ?? $this->model()->id());
} elseif ($this->model() instanceof File) {
$uuid = !empty($uuid) ? 'file://' . $uuid : null;
$command .= ' --file ' . $uuid ?? $this->model()->id();
$command .= ' --file ' . ($uuid ?? $this->model()->id());
} elseif ($this->model() instanceof User) {
$uuid = !empty($uuid) ? 'user://' . $uuid : null;
$command .= ' --user ' . $uuid ?? $this->model()->id();
$command .= ' --user ' . ($uuid ?? $this->model()->id());
} elseif ($this->model() instanceof Site) {
$command .= ' --site'; // boolean argument
}
$command .= ' --model ' . $uuid ??
($this->model() instanceof Site ? 'site://' : $this->model()->id());
$command .= ' --model ' . (
$uuid ?? ($this->model() instanceof Site ? 'site://' : $this->model()->id())
);

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

Expand Down
8 changes: 4 additions & 4 deletions vendor/composer/installed.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php return array(
'root' => array(
'name' => 'bnomei/kirby3-janitor',
'pretty_version' => '3.10.0',
'version' => '3.10.0.0',
'pretty_version' => '3.10.1',
'version' => '3.10.1.0',
'reference' => NULL,
'type' => 'kirby-plugin',
'install_path' => __DIR__ . '/../../',
Expand All @@ -11,8 +11,8 @@
),
'versions' => array(
'bnomei/kirby3-janitor' => array(
'pretty_version' => '3.10.0',
'version' => '3.10.0.0',
'pretty_version' => '3.10.1',
'version' => '3.10.1.0',
'reference' => NULL,
'type' => 'kirby-plugin',
'install_path' => __DIR__ . '/../../',
Expand Down

0 comments on commit 87ed4d8

Please sign in to comment.