Page MenuHomePhabricator

Flow: JavaScript error trying to highlight URL fragment
Closed, ResolvedPublic

Description

ui.js tries to highlight whatever's in the URL fragment:

highlightPost( $( '.flow-post' + window.location.hash ) );

without any validation that the selector $( '.flow-postXXX' ) exists, so if the fragment isn't loaded yet, or is just random #stuff, the JavaScript code $elem.offset().top fails. Thereafter page JavaScript like collapse/expand icons don't work.

With ?debug=1, the console shows (Firefox):

[00:07:02.739] TypeError: $elem.offset(...) is undefined @ http://ee-flow.wmflabs.org/w/extensions/Flow/modules/discussion/ui.js:324

or (Chromium):

Uncaught TypeError: Cannot read property 'top' of undefined

We'll need smarter fragment parsing sooner or later.


Version: master
Severity: normal
URL: http://ee-flow.wmflabs.org/wiki/Talk:First_release#bad

Details

Reference
bz58262

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 2:38 AM
bzimport set Reference to bz58262.
bzimport added a subscriber: Unknown Object (MLST).

bingle-admin wrote:

The WMF core features team tracks this bug on Mingle card https://mingle.corp.wikimedia.org/projects/flow/cards/602, but people from the community are welcome to contribute here and in Gerrit.

ErikB avoided the JS error with gerrit 100603.