Skip to content

Fix automatic redirects for Eloquent stored entries#601

Merged
duncanmcclean merged 3 commits into
7.xfrom
fix-eloquent-automatic-redirects
Jun 12, 2026
Merged

Fix automatic redirects for Eloquent stored entries#601
duncanmcclean merged 3 commits into
7.xfrom
fix-eloquent-automatic-redirects

Conversation

@joshuablum

Copy link
Copy Markdown
Member

When collections/entries are stored in the db using the Eloquent driver, automatic redirects are not getting created when the slug changes.

Since the current initialPath() check is a flat file agnostic, Eloquent entries are never loaded and initialPath() is always null so the handler returns early before caching the original URL. The result is that no redirect gets created.

This introduces a small helper that's storage-agnostic and resolve the previous slug to make automatic redirects work properly.

@duncanmcclean duncanmcclean merged commit f31a54f into 7.x Jun 12, 2026
14 checks passed
@duncanmcclean duncanmcclean deleted the fix-eloquent-automatic-redirects branch June 12, 2026 07:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants