Page MenuHomePhabricator

Flow rendering can drop text in a header edit
Closed, ResolvedPublic

Description

I was testing Flow's edit header. By chance I found adding some text after the template, e.g.

{{Flow-enabled}} some text afterwards

was not appearing. I reproduced on mediawiki.org and beta labs.

Yet if I reload the page or request it in another browser, the extra text appears. The extra text is in the API response, its "rendered" key ends with

"<table ...>... 
Again, your input is appreciated and needed!</td>
</tr></tbody></table> some text afterwards"

so where did the trailing text go?!

It turns out the jQuery replacement code in mw.flow.action.header.edit.prototype.render() in modules/header/forms.js is doing it:

.find( '#flow-header-content' )

.empty()
.removeClass( 'flow-header-empty' )
.append( $( output.rendered ) )
.end()

output.rendered contains all the HTML in the API response. But $( output.rendered ) *only* contains Object[table.plainlinks], not the HTML on the end. So it just vanishes, it is never inserted.

The same idiom of appending or prepending $( output.rendered ) occurs elsewhere in the JS code, I haven't tried reproducing this bug with other Flow elements or other kinds of generated HTML.


Version: master
Severity: normal

Details

Reference
bz64692

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 3:21 AM
bzimport set Reference to bz64692.
bzimport added a subscriber: Unknown Object (MLST).
Spage claimed this task.

This bug has long been fixed by changes to the Flow front-end.