fix(manager): stop an unknown template id from looping on an empty alert - #2437
Merged
Merged
Conversation
Opening ?a=16 with an id that has no record produced an alert box with no
text, and then reloaded the same URL for as long as the tab was open.
Two causes, one symptom:
* Controllers\Template::parameterData() passed a literal English sentence
to alertAndQuit(), whose second argument defaults to $lexicon = true.
getLexicon() returns '' for a key it does not know, so the message was
empty. Chunk, Snippet, Plugin and MoveDocument all pass false here for
a literal; Template was the one that did not.
* webAlertAndQuit() falls back to history.back(-1) when it is given no
URL. On a page that alerts as soon as it is opened, going back lands on
the request that raised the alert, which alerts again. Chrome suppresses
repeat dialogs after the first, so it runs silently.
alertAndQuit() takes a $url now and passes it through, and an unknown
lexicon key falls back to the string it was given, so no alert can be blank
again. Template sends the user to its own Cancel target.
Also fixes the stylesheet the alert page loads for itself: $path already
ends in '/', so appending '/css/styles.min.css' asked for
media/style/default//css/styles.min.css.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MXdDGZnGP6vGt9zTDG5o3n
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.
Opening ?a=16 with an id that has no record produced an alert box with no text, and then reloaded the same URL for as long as the tab was open.
Two causes, one symptom:
Controllers\Template::parameterData() passed a literal English sentence to alertAndQuit(), whose second argument defaults to $lexicon = true. getLexicon() returns '' for a key it does not know, so the message was empty. Chunk, Snippet, Plugin and MoveDocument all pass false here for a literal; Template was the one that did not.
webAlertAndQuit() falls back to history.back(-1) when it is given no URL. On a page that alerts as soon as it is opened, going back lands on the request that raised the alert, which alerts again. Chrome suppresses repeat dialogs after the first, so it runs silently.
alertAndQuit() takes a $url now and passes it through, and an unknown lexicon key falls back to the string it was given, so no alert can be blank again. Template sends the user to its own Cancel target.
Also fixes the stylesheet the alert page loads for itself: $path already ends in '/', so appending '/css/styles.min.css' asked for media/style/default//css/styles.min.css.