diff --git a/CHANGELOG.md b/CHANGELOG.md index 5456034..b3223c1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,9 +4,14 @@ 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/). -## 2.3.0 - 2022-05-21 +## 2.3.0.1 - 2022-05-21 + +> {warning} Craft 4.0 has been released, finally adding field layout conditionals to core! As such Reasons has become redundant, and will not be upgraded to support Craft 4 or later releases. **Before upgrading your site to Craft 4, make sure to note any conditionals that you'll want to re-create using the core feature, before uninstalling Reasons.** -> {warning} Craft 4.0 has been released, finally adding field layout conditionals to core! As such Reasons has become redundant, and will not be upgraded to support Craft 4 or later releases. **Before upgrading your site to Craft 4, make sure to note any conditionals that you'll want to re-create using the core feature, before uninstalling Reasons.** +### Fixed +- Fixes a regression error that could throw an exception + +## 2.3.0 - 2022-05-21 ### Fixed - Fixes an issue where conditionals would not work inside element slideouts for new entries or categories created via their fieldtypes diff --git a/composer.json b/composer.json index 41d82ed..256c044 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "mmikkel/reasons", "description": "Adds conditionals to field layouts.", "type": "craft-plugin", - "version": "2.3.0", + "version": "2.3.0.1", "keywords": [ "craft", "cms", diff --git a/src/Reasons.php b/src/Reasons.php index d8cc63e..5992580 100644 --- a/src/Reasons.php +++ b/src/Reasons.php @@ -250,6 +250,7 @@ protected function initAjaxRequest() if ($actionSegment === 'get-editor-html') { + $conditionalsKey = null; $elementId = (int)$request->getBodyParam('elementId'); if (!$elementId) { @@ -258,8 +259,6 @@ protected function initAjaxRequest() $attributes = $request->getBodyParam('attributes', []); $elementType = $request->getBodyParam('elementType'); - $conditionalsKey = null; - if ($elementType === Entry::class && $typeId = ($attributes['typeId'] ?? null)) { $conditionalsKey = "entryType:$typeId"; } else if ($elementType === Category::class && $groupId = ($attributes['groupId'] ?? null)) {