diff --git a/CHANGELOG.md b/CHANGELOG.md index 4f40004..ffaf63c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,9 @@ # Changelog + +## [1.3.1] - 2018-03-16 +### Fixed +- Category Elements are now supported + ## [1.3.0] - 2018-02-23 ### Added - Added **Cloudflare** support diff --git a/composer.json b/composer.json index 7386d56..7dfb016 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "ostark/upper", "description": "A cache plugin for Craft - supporting multiple Edge Caches", "type": "craft-plugin", - "version": "1.3.0", + "version": "1.3.1", "keywords": [ "craft", "cms", diff --git a/src/EventRegistrar.php b/src/EventRegistrar.php index c98e676..52da520 100644 --- a/src/EventRegistrar.php +++ b/src/EventRegistrar.php @@ -186,6 +186,7 @@ public static function registerFallback() protected static function handleUpdateEvent(Event $event) { if ($event instanceof ElementEvent) { + if (!Plugin::getInstance()->getSettings()->isCachableElement(get_class($event->element))) { return; } @@ -195,7 +196,7 @@ protected static function handleUpdateEvent(Event $event) } elseif ($event->element instanceof \craft\elements\Asset && $event->isNew) { $tag = $event->element->volumeId; } else { - $tag = ($event->isNew) + $tag = ($event->isNew && isset($event->element->sectionId)) ? Plugin::TAG_PREFIX_SECTION . $event->element->sectionId : Plugin::TAG_PREFIX_ELEMENT . $event->element->getId(); }