[3.0] Theme split (wave 1, part 6) — Repair the post preview - #9338
Merged
Conversation
Previewing a post does nothing: the preview section never appears and the console reports Uncaught ReferenceError: oEditorHandle_message is not defined Uncaught TypeError: sceditor.instance(...).getText is not a function Two separate leftovers from the SCEditor upgrade. oEditorHandle_<id> has not existed for some time, but the post and topic templates still assign it to oEditorObject. That throws, which abandons the rest of that inline script. Only quotedText.js ever read it, to decide whether the editor was in rich text mode, so ask SCEditor directly instead. oEditorID stays; quotedText.js and smf_fileUpload.js both still use it. getText() is gone from the bundled SCEditor, so gathering the form data for the preview died at the first field. val() is its replacement. spellcheck.js called it too, so it goes the same way. Wave 1, part 6 of breaking up SimpleMachines#7933. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Closed
live627
approved these changes
Aug 2, 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.
Wave 1, part 6 of breaking up #7933.
The preview does not work
On
release-3.0, pressing Preview on a post does nothing at all — the preview section never appears — and the console shows two errors:Both are leftovers from the SCEditor upgrade.
oEditorHandle_<id>has not existed for a long time, butPost.template.phpandDisplay.template.phpstill dowhich throws, and takes the rest of that inline
<script>block with it.quotedText.jswas the only reader, using it to decide whether the editor was in rich text mode, so it now asks SCEditor directly.oEditorIDis kept —quotedText.jsandsmf_fileUpload.jsboth still use it.getText()is gone from the bundled SCEditor, sosmc_preview_post.doPreviewPost()died on the first field it tried to collect.val()replaces it.spellcheck.jscalled it in two places as well, so those go the same way.Why not the plugin from #7933
#7933 replaces this with an
xmlPreviewSCEditor plugin. I did not port it, because it takes its form data once and keeps it:oSendDatais captured when the editor becomes ready and reused for every click after that, so the preview would show whatever the form held at page load rather than what was typed. Repairing the existing code is a much smaller change and keeps the behaviour people expect.I also left the
quoteFastplugin from that branch alone. Quoting works today, and that plugin finds the quote link by walking toel.children[iChildNum].firstElementChild— a fixed position in the quick-buttons list, which moves as soon as a button is hidden by permissions — and callsinsertQuoteFastunconditionally, dropping the case where the quick reply is collapsed and the click should take you to the full post page instead. I confirmed that path still works onrelease-3.0and did not want to regress it.Testing
Body typed <strong>after</strong> page load.thenCompletely different second body.oEditorIDstill resolves, and the rich-text mode flagquotedText.jssends computes correctly.Three
getText(false)calls remain inManageNews.template.phpandPersonalMessage.template.php. They sit inside'oEditorHandle_x' in windowguards that are always false, so they are unreachable; they belong to the parts that cover those templates.🤖 Generated with Claude Code