Skip to content

Commit fa6b3d0

Browse files
committed
Fix compatibility issue with Gatsby Helper
Fixes #20
1 parent cfc15a3 commit fa6b3d0

File tree

3 files changed

+25
-4
lines changed

3 files changed

+25
-4
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 1.0.9 - 2021-09-07
2+
### Fixed
3+
- Fix compatibility issue with Gatsby Helper (Fixes #20)
4+
15
## 1.0.8 - 2021-09-04
26
### Fixed
37
- Fix tags not being listed on index (Fixes #18, via @stevecomrie)

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "ether/tags",
33
"description": "A tag manager for Craft 3",
44
"type": "craft-plugin",
5-
"version": "1.0.8",
5+
"version": "1.0.9",
66
"keywords": [
77
"craft",
88
"cms",

src/TagManager.php

+20-3
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,14 @@
1010

1111
use Craft;
1212
use craft\base\Element;
13+
use craft\base\Model;
1314
use craft\base\Plugin;
1415
use craft\elements\actions\Edit;
1516
use craft\events\RegisterCpNavItemsEvent;
1617
use craft\events\RegisterElementActionsEvent;
1718
use craft\events\RegisterUrlRulesEvent;
19+
use craft\gatsbyhelper\events\RegisterIgnoredTypesEvent;
20+
use craft\gatsbyhelper\services\Deltas;
1821
use craft\web\twig\variables\Cp;
1922
use craft\web\UrlManager;
2023
use ether\tagManager\elements\actions\Delete;
@@ -24,6 +27,7 @@
2427
use Twig\Error\RuntimeError;
2528
use Twig\Error\SyntaxError;
2629
use yii\base\Event;
30+
use yii\base\Exception;
2731

2832
/**
2933
* Class Tags
@@ -71,6 +75,14 @@ public function init ()
7175
[$this, 'onRegisterCpNavItems']
7276
);
7377

78+
if (class_exists(Deltas::class)) {
79+
Event::on(
80+
Deltas::class,
81+
Deltas::EVENT_REGISTER_IGNORED_TYPES,
82+
[$this, 'onRegisterIgnoredTypes']
83+
);
84+
}
85+
7486
}
7587

7688
// Craft
@@ -86,13 +98,13 @@ public function getCpNavItem ()
8698
return $item;
8799
}
88100

89-
protected function createSettingsModel ()
101+
protected function createSettingsModel (): Settings
90102
{
91103
return new Settings();
92104
}
93105

94106
/**
95-
* @return bool|Settings|null
107+
* @return bool|Model|null
96108
*/
97109
public function getSettings ()
98110
{
@@ -103,7 +115,7 @@ public function getSettings ()
103115
* @return string|null
104116
* @throws LoaderError
105117
* @throws RuntimeError
106-
* @throws SyntaxError
118+
* @throws SyntaxError|Exception
107119
*/
108120
protected function settingsHtml ()
109121
{
@@ -162,4 +174,9 @@ public function onRegisterCpNavItems (RegisterCpNavItemsEvent $event)
162174
$event->navItems = $navItems;
163175
}
164176

177+
public function onRegisterIgnoredTypes (RegisterIgnoredTypesEvent $event)
178+
{
179+
$event->types[] = Tag::class;
180+
}
181+
165182
}

0 commit comments

Comments
 (0)