Skip to content

Commit 79dd051

Browse files
committed
Merge branch '5.x' into SLASH2NL/5.x
2 parents ac87a7f + 0b449b8 commit 79dd051

18 files changed

Lines changed: 274 additions & 274 deletions

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Release Notes for Craft CMS 5
22

3+
## Unreleased
4+
5+
- Fixed a bug where entries weren’t redirecting back to their section’s page’s URL by default.
6+
- 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))
9+
- Fixed a bug where reference tags weren’t working with generated fields. ([#18692](https://github.com/craftcms/cms/issues/18692))
10+
311
## 5.9.20 - 2026-04-14
412

513
- Fixed an issue that prevented Craft from being installed. ([#18700](https://github.com/craftcms/cms/issues/18700))

composer.lock

Lines changed: 240 additions & 240 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

phpstan.neon

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,5 +51,4 @@ parameters:
5151
- '#^Dead catch#'
5252
- '#^PHPDoc tag @mixin contains invalid type CraftTrait\.$#'
5353
- '#^Parameter \#2 \$callback of function usort expects#'
54-
- '#is never assigned craft\\base\\MemoizableArray#'
5554
treatPhpDocTypesAsCertain: false

src/base/Element.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2624,7 +2624,13 @@ public function __isset($name): bool
26242624
return $this->fieldByHandle(substr($name, 6)) !== null;
26252625
}
26262626

2627-
return $name === 'title' || $this->hasEagerLoadedElements($name) || parent::__isset($name) || $this->fieldByHandle($name);
2627+
return (
2628+
$name === 'title' ||
2629+
isset($this->_generatedFieldValues[$name]) ||
2630+
$this->hasEagerLoadedElements($name) ||
2631+
parent::__isset($name) ||
2632+
$this->fieldByHandle($name)
2633+
);
26282634
}
26292635

26302636
/**
@@ -3423,7 +3429,7 @@ public function getSearchKeywords(string $attribute): string
34233429
$event = new DefineAttributeKeywordsEvent(['attribute' => $attribute]);
34243430
$this->trigger(self::EVENT_DEFINE_KEYWORDS, $event);
34253431
if ($event->handled) {
3426-
return $event->keywords ?? '';
3432+
return $event->keywords;
34273433
}
34283434
}
34293435

src/base/FieldLayoutElement.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ protected function containerAttributes(?ElementInterface $element = null, bool $
105105
{
106106
$attributes = [];
107107
if ($this->hasCustomWidth()) {
108-
$attributes['class'][] = 'width-' . ($this->width ?? 100);
108+
$attributes['class'][] = "width-$this->width";
109109
}
110110
return $attributes;
111111
}

src/config/app.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@
2626
'assetIndexer' => [
2727
'class' => craft\services\AssetIndexer::class,
2828
],
29+
'assetManager' => function() {
30+
$config = craft\helpers\App::assetManagerConfig();
31+
return Craft::createObject($config);
32+
},
2933
'auth' => [
3034
'class' => craft\services\Auth::class,
3135
],

src/config/app.web.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@
55
return [
66
'class' => craft\web\Application::class,
77
'components' => [
8-
'assetManager' => function() {
9-
$config = craft\helpers\App::assetManagerConfig();
10-
return Craft::createObject($config);
11-
},
128
'dumper' => function() {
139
$dumper = new HtmlDumper();
1410
$dumper->setTheme('light');

src/controllers/EntriesController.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,6 @@ public function actionSaveEntry(bool $duplicate = false): ?Response
320320
$success = false;
321321
} finally {
322322
if ($isNotNew) {
323-
/** @phpstan-ignore-next-line */
324323
$mutex->release($lockKey);
325324
}
326325
}

src/elements/Entry.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2275,7 +2275,8 @@ protected function cpEditUrl(): ?string
22752275
*/
22762276
public function getPostEditUrl(): ?string
22772277
{
2278-
return UrlHelper::cpUrl('entries');
2278+
$page = $this->getSection()?->getPage();
2279+
return UrlHelper::cpUrl(sprintf('content/%s', $page ? StringHelper::toKebabCase($page) : 'entries'));
22792280
}
22802281

22812282
/**
@@ -2485,7 +2486,7 @@ protected function inlineAttributeInputHtml(string $attribute): string
24852486
],
24862487
'single' => false,
24872488
'elements' => $authors ?: null,
2488-
'disabled' => false,
2489+
'disabled' => !$this->canChangeAuthor(),
24892490
'errors' => $this->getErrors('authorIds'),
24902491
'limit' => $section->maxAuthors,
24912492
]);
@@ -2797,10 +2798,6 @@ private function canChangeAuthor(?User $user = null): bool
27972798

27982799
$section = $this->getSection();
27992800

2800-
if (!$user->can("viewPeerEntries:$section->uid")) {
2801-
return false;
2802-
}
2803-
28042801
$authorIds = $this->getAuthorIds();
28052802

28062803
return (

src/fields/Date.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,9 @@ public function normalizeValue(mixed $value, ?ElementInterface $element): mixed
422422
return null;
423423
}
424424

425+
/** @phpstan-ignore-next-line */
425426
if ($this->showTimeZone && (isset($timeZone) || (is_array($value) && !empty($value['timezone'])))) {
427+
/** @phpstan-ignore-next-line */
426428
$date->setTimezone(new DateTimeZone($timeZone ?? $value['timezone']));
427429
}
428430

0 commit comments

Comments
 (0)