Skip to content

Commit

Permalink
Nghhh
Browse files Browse the repository at this point in the history
  • Loading branch information
mmikkel committed May 21, 2022
1 parent a9049c4 commit 6a87dee
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
9 changes: 7 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
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": "mmikkel/reasons",
"description": "Adds conditionals to field layouts.",
"type": "craft-plugin",
"version": "2.3.0",
"version": "2.3.0.1",
"keywords": [
"craft",
"cms",
Expand Down
3 changes: 1 addition & 2 deletions src/Reasons.php
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ protected function initAjaxRequest()

if ($actionSegment === 'get-editor-html') {

$conditionalsKey = null;
$elementId = (int)$request->getBodyParam('elementId');

if (!$elementId) {
Expand All @@ -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)) {
Expand Down

0 comments on commit 6a87dee

Please sign in to comment.