Skip to content
This repository has been archived by the owner on Apr 18, 2024. It is now read-only.

Commit

Permalink
fix for #9 (Category Elements)
Browse files Browse the repository at this point in the history
  • Loading branch information
Oliver Stark committed Mar 16, 2018
1 parent 6b15cce commit c5c96a4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
3 changes: 2 additions & 1 deletion src/EventRegistrar.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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();
}
Expand Down

0 comments on commit c5c96a4

Please sign in to comment.