Skip to content

Commit 721d05e

Browse files
committed
Fixed entries’ post-edit URLs
#18680 (review)
1 parent 415db86 commit 721d05e

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
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+
37
## 5.9.20 - 2026-04-14
48

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

src/elements/Entry.php

Lines changed: 2 additions & 1 deletion
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
/**

0 commit comments

Comments
 (0)