diff --git a/CHANGELOG.md b/CHANGELOG.md index 1dd27d0..7abadad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## 3.0.1 - 2019.12.13 +### Fixed +- Issue with calling `$user->getIsGuest()` from plugin `init` (before app is fully bootstrapped) + ## 3.0.0 - 2019.06.02 ### Added - Config `messageTemplate` for the warning message. This is parsed as twig. Default value `'May also be edited by: {{user.username}}.'` diff --git a/composer.json b/composer.json index 6eae245..9280f6c 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "marionnewlevant/snitch", "description": "Report when two people might be editing the same element (eg entry, category, or global) or field", "type": "craft-plugin", - "version": "3.0.0", + "version": "3.0.1", "keywords": [ "craft", "cms", diff --git a/src/Snitch.php b/src/Snitch.php index 0ab1e32..4519767 100644 --- a/src/Snitch.php +++ b/src/Snitch.php @@ -85,7 +85,7 @@ public function init() 'collision' => Collision::class, ]); - if (Craft::$app->getRequest()->getIsCpRequest() && !Craft::$app->getUser()->getIsGuest() && !Craft::$app->getRequest()->getIsAjax()) { + if (Craft::$app->getRequest()->getIsCpRequest() && !Craft::$app->getRequest()->getIsAjax()) { // Register our asset bundle Craft::$app->getView()->registerAssetBundle(SnitchAsset::class); // on save, remove any collision for this element.