[7870] Modifying Page URL does not reload page URL on Save & Close#4788
Merged
sumerjabri merged 4 commits intocraftercms:developfrom Mar 13, 2026
Merged
[7870] Modifying Page URL does not reload page URL on Save & Close#4788sumerjabri merged 4 commits intocraftercms:developfrom
sumerjabri merged 4 commits intocraftercms:developfrom
Conversation
WalkthroughModified the save callback in Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Fix all issues with AI agents
In `@ui/app/src/utils/system.ts`:
- Around line 138-140: The inline comment near usages of oldProps.path and the
preview URL contains a typo "is as page" — update the comment in
ui/app/src/utils/system.ts (the block referencing oldProps.path and "preview
page path") to read "is a page" instead of "is as page" so the comment correctly
states "oldProps.path is a page and the same as the preview page path, but the
new path is different..." and preserves the surrounding explanatory text.
- Around line 131-136: The code calls getPathFromPreviewURL(previewURL) where
previewURL comes from params.get('page') and may be null; add a null guard so
you only call getPathFromPreviewURL when previewURL is a non-null string (e.g.,
check previewURL != null or typeof previewURL === 'string') before comparing to
oldProps.path; update the conditional that uses isPagePath(oldProps.path) &&
getPathFromPreviewURL(previewURL) === oldProps.path && oldProps.path !==
result.path to short-circuit when previewURL is null (treat as non-matching) to
avoid passing null into getPathFromPreviewURL.
- Around line 136-146: The navigation logic currently compares oldProps.path !==
result.path and then computes getPreviewURLFromPath(result.path) which can be
undefined for embedded-component saves; update the guard to only run the
rename/redirect when result.path is defined (non-empty) and different from
oldProps.path (e.g., if (result.path && oldProps.path !== result.path) ...), so
that getPreviewURLFromPath is only called with a valid path before calling
getSystemLink and setting window.location.href; ensure you reference
oldProps.path, result.path, getPreviewURLFromPath and getSystemLink when
applying the check.
rart
approved these changes
Mar 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
craftercms/craftercms#7870
Original issue is no longer happening now that the new dialogs system is in. Updated the dialogs to subscribe at the websocket to check for content events and re-fetch dependant items if neccessary
Summary by CodeRabbit