Last modified: 2014-07-19 12:40:21 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T67425, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 65425 - Hovercards: TypeError: re.query is undefined on # links
Hovercards: TypeError: re.query is undefined on # links
Status: ASSIGNED
Product: MediaWiki extensions
Classification: Unclassified
Popups (Other open bugs)
unspecified
All All
: Unprioritized normal (vote)
: ---
Assigned To: Prateek Saxena
: javascript
Depends on:
Blocks: 63181
  Show dependency treegraph
 
Reported: 2014-05-16 23:00 UTC by Helder
Modified: 2014-07-19 12:40 UTC (History)
5 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Helder 2014-05-16 23:00:50 UTC
I'm getting "TypeError: re.query is undefined" whenever I put the mouse over the "Expandir" link on
https://pt.wikipedia.org/wiki/Golfinho#catlinks
Comment 1 Prateek Saxena 2014-05-17 10:10:14 UTC
Ideally there should be no error as the extension should not try to generate a popup.
Comment 2 Gerrit Notification Bot 2014-05-24 08:41:53 UTC
Change 135188 had a related patch set uploaded by Prtksxna:
renderer: Ignore links meant for JavaScript

https://gerrit.wikimedia.org/r/135188
Comment 3 Gerrit Notification Bot 2014-05-29 00:34:23 UTC
Change 135188 merged by jenkins-bot:
renderer: Ignore `#` links

https://gerrit.wikimedia.org/r/135188
Comment 4 spage 2014-05-30 02:23:24 UTC
Gerrit change #135188 ignores '#', which is often the href of "links" that trigger JavaScript operations such as expand/contract, etc.  However, you also see this error in the console when hovering over a section link in a ToC, because it goes to #Section_name and the title for it is empty.

So a better, more comprehensive fix should be to
a) test
   if (link.attr( 'href').indexOf( '#' ) === 0 )

and
b) never access object.keyA.keyB in a JS structure without testing object.keyA first

and
c) don't issue the API query for an empty or otherwise invalid title (bug. The title is usually (always?) empty for section links.

But I'm confused, shouldn't the test for href is or starts with '#' go in mw.popups.setupTriggers(), which is already testing href?
Comment 5 Prateek Saxena 2014-06-04 05:29:50 UTC
(In reply to spage in comment #4)

#134266 moves the selector to a single function that is reused in `removeTooltips` and `setupTriggers`. `setupTriggers` still does have some logic for the shortlisting links on the basis of it `href`. Moving that logic to `selectPopupElements` should solve the problem.

We also have to keep in mind that has as soon as we start with the reference popups we'll have to remove some of these checks and move them into the renderer instead which'll pass it along to either the article or the reference renderer.

We can put (a) as the citation links always have the name after the `#`. I didn't understand the relevance of (b) in this context. We are checking for empty title in `selectPopupsElements` so I guess we won't have to worry about (c) then.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links