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

Commit 674d880

Browse files
author
Oliver Stark
committed
Prevent purge after resave entries
1 parent 48f53b7 commit 674d880

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Changelog
22

3+
## [1.5.1] - 2019-05-03
4+
- Prevent purge on resaving
5+
36
## [1.5.0] - 2019-03-12
47
- Added support for multiple varnish servers (@larsboldt)
58
- Fixed a bug when using `keyPrefix`

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "ostark/upper",
33
"description": "A cache plugin for Craft - supporting multiple Edge Caches",
44
"type": "craft-plugin",
5-
"version": "1.5.0",
5+
"version": "1.5.1",
66
"keywords": [
77
"craft",
88
"cms",

src/EventRegistrar.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,11 @@ protected static function handleUpdateEvent(Event $event)
202202
return;
203203
}
204204

205+
// Prevent purge on resaving
206+
if (property_exists($event->element, 'resaving') && $event->element->resaving === true) {
207+
return;
208+
}
209+
205210
if ($event->element instanceof \craft\elements\GlobalSet && is_string($event->element->handle)) {
206211
$tags[] = $event->element->handle;
207212
} elseif ($event->element instanceof \craft\elements\Asset && $event->isNew) {

0 commit comments

Comments
 (0)