Skip to content

Commit

Permalink
updated autoid modified check
Browse files Browse the repository at this point in the history
Signed-off-by: Bruno Meilick <b@bnomei.com>
  • Loading branch information
bnomei committed Dec 20, 2019
1 parent 391d2e4 commit 4b1c92d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
13 changes: 9 additions & 4 deletions classes/FingerprintFile.php
Expand Up @@ -61,14 +61,19 @@ public function modified(): ?int
return null;
}

if ($this->isKirbyFile && function_exists('autoid') && $this->file->autoid()->isNotEmpty()) {
$modified = null;
if ($this->isKirbyFile && function_exists('modified') && $this->file->autoid()->isNotEmpty()) {
// @codeCoverageIgnoreStart
$autoid = autoid()->filterBy('autoid', $this->file->autoid())->first();
return $autoid && is_array($autoid) ? A::get($autoid, 'modified') : F::modified($root);
$modified = modified($this->file->autoid()->value());
if (!$modified) {
$modified = $this->file->modified();
}
// @codeCoverageIgnoreEnd
} else {
$modified = F::modified($root);
}

return F::modified($root);
return $modified;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion composer.json
@@ -1,7 +1,7 @@
{
"name": "bnomei/kirby3-fingerprint",
"type": "kirby-plugin",
"version": "3.0.5",
"version": "3.0.6",
"description": "File Method and css/js helper to add cachebusting hash and optional Subresource Integrity to file",
"license": "MIT",
"authors": [
Expand Down

0 comments on commit 4b1c92d

Please sign in to comment.