Repository navigation
fix(widgetrestapi): use the resolved theme id when re-rendering a single message - #2418
Merged
remdex merged 1 commit intoOct 7, 2026
Conversation
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.
Problem
widgetrestapi/fetchmessageresolves the theme withextractTheme(), but then fetches it with the raw request value:When a widget theme has an alias, the embed code passes the alias, and
extractTheme()refuses the numeric id for that theme.fetch('my-alias')looks the alias up as a primary key and returnsfalse, so the message is rendered without a theme.The widget calls this endpoint whenever it refreshes a single message row (
lhinst.updateMessageRow): after a visitor reaction, an operator edit or delete, or a translation. On an alias theme the refreshed row loses everything that depends on the theme. The message time and the reaction toolbar disappear, so a visitor who clicks a reaction sees it vanish instead of being selected.fetchmessagesand the other endpoints already use$themeId.Fix
Fetch the theme by the id
extractTheme()returned.How I tested
On a clean install of current master (PHP 8.3, MariaDB 11) with a widget theme that has an alias, message time visible for all messages, and visitor reactions enabled:
fetchmessagesreturns the operator row with its time and two reaction buttons.fetchmessagefor the same row returned no time and no reaction buttons before this change, and the same row asfetchmessagesafter it.