Skip to content

Commit 349d223

Browse files
committed
Merge branch '5.x' into 5.10
2 parents d8d3532 + 2eb9ecb commit 349d223

3 files changed

Lines changed: 7 additions & 13 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
- Fixed a bug where entries weren’t redirecting back to their section’s page’s URL by default.
66
- Fixed a bug where the `resourceBasePath` and `resourceBaseUrl` config settings weren’t being respected for console requests. ([#18685](https://github.com/craftcms/cms/issues/18685))
7+
- Fixed a bug where eager-loadable GraphQL fields could be populated with the wrong field’s results, if they followed a fragment with a `*Interface` type condition. ([#18708](https://github.com/craftcms/cms/issues/18708))
8+
- Fixed a bug where users with permission to edit entries, but not view peer entries in a section, weren’t allowed to edit the authors for entries in the section. ([#18717](https://github.com/craftcms/cms/pull/18717))
79

810
## 5.9.20 - 2026-04-14
911

src/elements/Entry.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2493,7 +2493,7 @@ protected function inlineAttributeInputHtml(string $attribute): string
24932493
],
24942494
'single' => false,
24952495
'elements' => $authors ?: null,
2496-
'disabled' => false,
2496+
'disabled' => !$this->canChangeAuthor(),
24972497
'errors' => $this->getErrors('authorIds'),
24982498
'limit' => $section->maxAuthors,
24992499
]);
@@ -2805,10 +2805,6 @@ private function canChangeAuthor(?User $user = null): bool
28052805

28062806
$section = $this->getSection();
28072807

2808-
if (!$user->can("viewPeerEntries:$section->uid")) {
2809-
return false;
2810-
}
2811-
28122808
$authorIds = $this->getAuthorIds();
28132809

28142810
return (

src/gql/ElementQueryConditionBuilder.php

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -548,17 +548,13 @@ private function _traverseAndBuildPlans(Node $parentNode, EagerLoadPlan $parentP
548548
$subNode = $this->_fragments[$nodeName];
549549
}
550550

551-
$wrappingFragment = $subNode;
552-
553-
$nodeName = $subNode->typeCondition->name->value;
554-
555551
// If we are inside a field that supports different subtypes, it should implement the appropriate interface
556552
if ($parentField instanceof GqlInlineFragmentFieldInterface) {
557553
// Get the Craft entity that correlates to the fragment
558554
// Build the prefix, load the context and proceed in a recursive manner
559555
try {
560-
$gqlFragmentEntity = $parentField->getGqlFragmentEntityByName($nodeName);
561-
$plan->nested = $this->_traverseAndBuildPlans($subNode, $plan, $parentField, $wrappingFragment, $gqlFragmentEntity->getFieldContext());
556+
$gqlFragmentEntity = $parentField->getGqlFragmentEntityByName($subNode->typeCondition->name->value);
557+
$plan->nested = $this->_traverseAndBuildPlans($subNode, $plan, $parentField, $subNode, $gqlFragmentEntity->getFieldContext());
562558

563559
// Correct the handles and, maybe, aliases.
564560
foreach ($plan->nested as $nestedPlan) {
@@ -570,11 +566,11 @@ private function _traverseAndBuildPlans(Node $parentNode, EagerLoadPlan $parentP
570566
}
571567
// This is to be expected, depending on whether the fragment is targeted towards the field itself instead of its subtypes.
572568
} catch (InvalidArgumentException) {
573-
$plan->nested = $this->_traverseAndBuildPlans($subNode, $plan, $parentField, $wrappingFragment, $context);
569+
$plan->nested = $this->_traverseAndBuildPlans($subNode, $plan, $parentField, $subNode, $context);
574570
}
575571
// If we are not, just expand the fragment and traverse it as if on the same level in the query tree
576572
} else {
577-
$plan->nested = $this->_traverseAndBuildPlans($subNode, $plan, $parentField, $wrappingFragment, $context);
573+
$plan->nested = $this->_traverseAndBuildPlans($subNode, $plan, $parentField, $subNode, $context);
578574
}
579575
}
580576

0 commit comments

Comments
 (0)