Skip to content

Commit

Permalink
Use canonicalId in New Child links. Bump to 2.2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
mmikkel committed Jun 10, 2024
1 parent 901c9e7 commit 54e022a
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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/).

## 2.2.2 - 2024-06-10
### Fixed
- Fixed an incompatibility issue with Craft 5.2, which could trigger a PHP exception when attempting to create a new child for "Edited" elements

## 2.2.1 - 2024-05-31
### Fixed
- Fixed a misalignment issue with "New child" buttons in element index columns
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
"name": "mmikkel/child-me",
"description": "Easily create child elements",
"type": "craft-plugin",
"version": "2.2.1",
"version": "2.2.2",
"keywords": [
"craft",
"cms",
4 changes: 2 additions & 2 deletions src/ChildMe.php
Original file line number Diff line number Diff line change
@@ -190,7 +190,7 @@ private function _renderChildMeButtonForEntry(Entry $entry): string
return [
'url' => UrlHelper::cpUrl("entries/$section->handle/new", [
'site' => $entry->getSite()?->handle,
'parentId' => $entry->id,
'parentId' => $entry->canonicalId,
'typeId' => $entryType->id,
]),
'label' => $entryType->name,
@@ -233,7 +233,7 @@ private function _renderChildMeButtonForCategory(Category $category): string
'links' => [[
'url' => UrlHelper::cpUrl("categories/$group->handle/new", [
'site' => $category->getSite()?->handle,
'parentId' => $category->id,
'parentId' => $category->canonicalId,
])
]],
'element' => $category,

0 comments on commit 54e022a

Please sign in to comment.