Skip to content

Commit 9637224

Browse files
committed
1.0.4
- Fixed an error with hooks
1 parent ff6bc69 commit 9637224

File tree

4 files changed

+12
-6
lines changed

4 files changed

+12
-6
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
All notable changes to `X-Ray` will be documented in this file.
44

5+
## 1.0.4 - 2025-10-07
6+
7+
- Fixed an error with hooks
8+
59
## 1.0.3 - 2025-08-20
610

711
- Update plugin prefix to `beebmx.x-ray`

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"description": "X-Ray provides a comprehensive overview of the content present on your site and individual pages, allowing you to inspect and evaluate them at a glance.",
44
"license": "MIT",
55
"type": "kirby-plugin",
6-
"version": "1.0.3",
6+
"version": "1.0.4",
77
"keywords": [
88
"xray",
99
"x-ray",

extensions/hooks.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,20 @@
66
use Kirby\Cms\Page;
77

88
return [
9-
'file.*:before' => function (Event $event, File $file) {
9+
'file.*:before' => function (Event $event, ?File $file) {
1010
if ($this->option('beebmx.x-ray.cache', true)
1111
&& $this->option('beebmx.x-ray.autoclean.files', true)
12-
&& in_array($event->action(), ['changeTemplate', 'changeSort']) !== true) {
12+
&& in_array($event->action(), ['changeTemplate', 'changeSort']) !== true
13+
&& $file) {
1314
(new ClearCache)($this, $file->parent());
1415
(new ClearCache)($this, $this->site());
1516
}
1617
},
17-
'page.*:before' => function (Event $event, Page $page) {
18+
'page.*:before' => function (Event $event, ?Page $page) {
1819
if ($this->option('beebmx.x-ray.cache', true)
1920
&& $this->option('beebmx.x-ray.autoclean.pages', true)
20-
&& in_array($event->action(), ['changeTemplate', 'changeNum', 'render']) !== true) {
21+
&& in_array($event->action(), ['changeTemplate', 'changeNum', 'render']) !== true
22+
&& $page) {
2123
(new ClearCache)($this, $page);
2224
(new ClearCache)($this, $this->site());
2325
}

tests/Pest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ function App(array $roots = [], array $options = []): App
3838
'content' => $base.'/content',
3939
], $roots),
4040
'options' => array_merge([
41-
'beebmx.kirby-summary' => require dirname(__DIR__).'/extensions/options.php',
41+
'beebmx.x-ray' => require dirname(__DIR__).'/extensions/options.php',
4242
], $options),
4343
'areas' => require dirname(__DIR__).'/extensions/areas.php',
4444
]);

0 commit comments

Comments
 (0)