diff --git a/CHANGELOG.md b/CHANGELOG.md index 3bb98e0..df2b5bd 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/). +## 1.4.5 - 2022-07-14 +### Improved +- MatrixMate now defers registering its CP resources to an `Application::EVENT_INIT` event handler, reducing the risk of conflicting with other plugins. + ## 1.4.4 - 2022-06-22 ### Fixed - Fixes an issue where adding a block via existing blocks' disclosure menu could put a hash symbol in the browser's address bar, potentially causing various issues. diff --git a/composer.json b/composer.json index 6ff83ba..e123d95 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "vaersaagod/matrixmate", "description": "Welding Matrix into shape, mate!", "type": "craft-plugin", - "version": "1.4.4", + "version": "1.4.5", "keywords": [ "craft", "cms", diff --git a/src/MatrixMate.php b/src/MatrixMate.php index deddaae..13c2f15 100644 --- a/src/MatrixMate.php +++ b/src/MatrixMate.php @@ -20,7 +20,7 @@ use craft\elements\User; use craft\helpers\Json; use craft\services\Fields; -use craft\services\Plugins; +use craft\web\Application; use craft\web\Controller; use vaersaagod\matrixmate\assetbundles\matrixmate\MatrixMateAsset; @@ -79,9 +79,9 @@ public function init() // Defer further initialisation to after plugins have loaded, and only for CP web requests if (Craft::$app->getRequest()->getIsCpRequest() && !Craft::$app->getRequest()->getIsConsoleRequest()) { Event::on( - Plugins::class, - Plugins::EVENT_AFTER_LOAD_PLUGINS, - [$this, 'onAfterLoadPlugins'] + Application::class, + Application::EVENT_INIT, + [$this, 'onAppInit'] ); } @@ -98,7 +98,7 @@ public function init() /** * @return void */ - public function onAfterLoadPlugins(): void + public function onAppInit(): void { if (!Craft::$app->getUser()->checkPermission('accessCp')) {