Skip to content

Commit

Permalink
3.0.1
Browse files Browse the repository at this point in the history
Issue with calling `$user->getIsGuest()` from plugin `init` (before app is fully bootstrapped)
  • Loading branch information
marionnewlevant committed Dec 14, 2019
1 parent bcd40da commit 0993839
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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: <a href="mailto:{{user.email}}">{{user.username}}</a>.'`
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": "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",
Expand Down
2 changes: 1 addition & 1 deletion src/Snitch.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 0993839

Please sign in to comment.