From 6202570bcbfb791305e80078ddd477696bac94d2 Mon Sep 17 00:00:00 2001 From: brandonkelly Date: Mon, 6 Jan 2025 10:31:51 -0800 Subject: [PATCH 1/2] Fixed structure relationship eager-loading on some envs Fixes #16381 Fixes #16382 --- CHANGELOG.md | 1 + src/base/Element.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4c176861530..ad5f2931c18 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - Fixed a bug where custom fields could cause validation errors when running the `users/create` command. - Fixed a bug where deleting a volume folder wasn’t fully deleting asset data in descendant folders. +- Fixed a bug where `ancestors`, `children`, `descendants`, and `parent` eager-loading wasn’t working on some environments. ([#16381](https://github.com/craftcms/cms/issues/16381), [#16382](https://github.com/craftcms/cms/issues/16382)) ## 4.13.8 - 2025-01-02 diff --git a/src/base/Element.php b/src/base/Element.php index 17704bf9edd..46066b55bdf 100644 --- a/src/base/Element.php +++ b/src/base/Element.php @@ -1469,7 +1469,7 @@ private static function _mapDescendants(array $sourceElements, bool $children): foreach ($elementStructureData as $elementStructureDatum) { foreach ($descendantStructureData as $descendantStructureDatum) { if ( - $descendantStructureDatum['structureId'] === $elementStructureDatum['structureId'] && + $descendantStructureDatum['structureId'] == $elementStructureDatum['structureId'] && $descendantStructureDatum['lft'] > $elementStructureDatum['lft'] && $descendantStructureDatum['rgt'] < $elementStructureDatum['rgt'] && (!$children || $descendantStructureDatum['level'] == $elementStructureDatum['level'] + 1) From e982ab8c3990c7f4cfec09bc6bfcc1a769450823 Mon Sep 17 00:00:00 2001 From: brandonkelly Date: Mon, 6 Jan 2025 10:33:21 -0800 Subject: [PATCH 2/2] Finish 4.13.9 --- CHANGELOG.md | 2 +- src/config/app.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ad5f2931c18..e2ad6f1f0bd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Release Notes for Craft CMS 4 -## Unreleased +## 4.13.9 - 2025-01-06 - Fixed a bug where custom fields could cause validation errors when running the `users/create` command. - Fixed a bug where deleting a volume folder wasn’t fully deleting asset data in descendant folders. diff --git a/src/config/app.php b/src/config/app.php index 2336b7570c3..95bf7853436 100644 --- a/src/config/app.php +++ b/src/config/app.php @@ -3,7 +3,7 @@ return [ 'id' => 'CraftCMS', 'name' => 'Craft CMS', - 'version' => '4.13.8', + 'version' => '4.13.9', 'schemaVersion' => '4.5.3.0', 'minVersionRequired' => '3.7.11', 'basePath' => dirname(__DIR__), // Defines the @app alias