Skip to content

Commit

Permalink
Really fixed category sorting
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonkelly committed Apr 4, 2023
1 parent 6b07ee1 commit 1b4ad6e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,9 @@
# Release Notes for Craft CMS 4

## Unreleased

- Fixed a bug where Categories fields weren’t retaining custom sort orders when “Maintain hierarchy” was disabled. ([#10560](https://github.com/craftcms/cms/discussions/10560))

## 4.4.6 - 2023-04-04

- Content tab menus now reveal when a tab contains validation errors, and invalid tabs’ menu options get the same warning icon treatment as inline tabs do. ([#12971](https://github.com/craftcms/cms/issues/12971))
Expand Down
2 changes: 1 addition & 1 deletion src/fields/Categories.php
Expand Up @@ -90,7 +90,7 @@ public function __construct(array $config = [])
*/
public function normalizeValue(mixed $value, ?ElementInterface $element = null): mixed
{
if (is_array($value)) {
if (is_array($value) && $this->maintainHierarchy) {
/** @var Category[] $categories */
$categories = Category::find()
->siteId($this->targetSiteId($element))
Expand Down

0 comments on commit 1b4ad6e

Please sign in to comment.