PhoenixKit.Modules.Publishing.Web.Controller.Fallback (phoenix_kit v1.7.42)
Copy Markdown View Source404 fallback handling for the publishing controller.
Implements a smart fallback chain that attempts to redirect users to related content when the requested resource is not found:
- Posts in other languages
- Other posts on the same date
- Blog listing page
Summary
Functions
Fallback for timestamp mode posts - comprehensive fallback chain
Tries to find any available published language version of the post.
Tries each language for timestamp mode until finding a published version. Handles both versioned and legacy structures.
Handles 404 not found responses with smart fallback.
Functions
Fallback for timestamp mode posts - comprehensive fallback chain:
- Try other languages for the exact date/time
- If time doesn't exist, try other times on the same date
- If date has no posts, fall back to blog listing
Tries to find any available published language version of the post.
Priority:
- Check for published versions in the SAME language first (across all versions)
- Then try other languages
- Falls back to blog listing if no published versions exist
Note: fetch_post now handles finding the latest published version automatically, so we can just use base URLs here (no version-specific URLs needed)
Tries each language for timestamp mode until finding a published version. Handles both versioned and legacy structures.
Handles 404 not found responses with smart fallback.