[3.0] Stop every topic row emitting an attribute named " - #9454
Open
albertlast wants to merge 1 commit into
Open
[3.0] Stop every topic row emitting an attribute named "#9454albertlast wants to merge 1 commit into
albertlast wants to merge 1 commit into
Conversation
The wrapper inside each topic's info cell builds its data-msg-id by hand, leaving the closing quote to the string that follows it: <div ', (!empty($topic['quick_mod']['modify']) ? 'data-msg-id="' . $topic['first_post']['id'] : ''), '"> That works when there is an id to write. When there is not - which is the default, since display_quick_mod is off unless a member turns it on - the ternary contributes nothing and the row emits <div ">, so every topic on every message index carries an attribute whose name is a double quote. Puts the whole attribute inside the ternary, quotes and all. quick mod off <div "> becomes <div> quick mod on data-msg-id="12" either way Signed-off-by: Mathias Albert <mathiaspapealbert@hotmail.com> Signed-off-by: albertlast <mathiaspapealbert@hotmail.com>
Closed
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.
Description
The wrapper inside each topic's info cell builds its
data-msg-idby hand, leaving the closing quote to the string that follows it:That works when there is an id to write. When there is not — which is the default, since
display_quick_modis a theme option that is off unless a member turns it on — the ternary contributes nothing and the row emits<div ">. Every topic, on every message index, carries an attribute whose name is a double quote:{"attrs": ["\"=\"\""], "outer": "<div \"=\"\"> <div id=\"icons12\" class=\"icons floatright\">…"}Same shape as the
checked"problem fixed in #9428: the attribute is assembled across the boundary between the ternary and the literal. Putting the whole thing inside the ternary fixes it.<div "><div>data-msg-id="12"data-msg-id="12"Measured on six topic rows with the option off, then on, by enabling
display_quick_modfor the test account.Separately: the attribute's consumer does not work
Not fixed here, because it needs a rewrite rather than a correction, but worth recording while it is in front of us.
QuickModifyTopicis constructed unconditionally on every message index and is supposed to give topics inline subject editing on double-click. It does not, for three independent reasons:el.children[1].dataset.msgIdis the.infocell, whiledata-msg-idis on thedivone level inside it. Measured with the option on:.infogivesundefinedwhile its child givesdata-msg-id="12". The listener is therefore never attached.this.modify_topic.bind(this, …dataset.msgId), somodify_topic(topic_id, first_msg_id)receives the message id astopic_idand the click event asfirst_msg_id.document.getElementById('msg_' + first_msg_id), but the template emitsid="msg12"— no underscore.I have left all three alone. Reviving the feature means verifying the whole AJAX round trip, which is its own piece of work, and I did not want to bury it inside a markup fix.
Issues References (Fixes|Related|Closes)
Related: #9428, #7933