Page MenuHomePhabricator

Search suggestions aren't working on Portuguese Wikisource
Closed, ResolvedPublic

Description

No event listeners for #searchInput on ptwikisource

Go to [[wikisource:pt:Main page]] and to also [[Main page]] and compare the result of following these steps:

  • Go to the main page
  • Click on the search box
  • Type "a"

On:

  • [[Main page]]: some suggestions are displayed
  • [[wikisource:pt:Main page]]: nothing happens

I've tested this both signed in/out, in both secure and unsecure servers, and both on Chromium 12.0.742.112 (90304) Ubuntu 11.04 and Firefox 5.0.

When the event listeners of the #searchInput element are inspected on Chromium:

  • [[Main page]]: has some events
  • [[wikisource:pt:Main page]]: has no events

I didn't find the cause on the local [[MediaWiki:Common.js]], but it is likely to be there, since other wikisources doesn't have the same problem.

See also:

  • Bug 29516 - Searchbox displays text in gray instead of black

Version: 1.20.x
Severity: normal
URL: http://pt.wikisource.org/wiki/
See Also:
https://bugzilla.wikimedia.org/show_bug.cgi?id=29516

Attached:

No_event_listeners_for_searchInput_on_ptwikisource.png (768×1 px, 134 KB)

Details

Reference
bz29801
TitleReferenceAuthorSource BranchDest Branch
Remove static validation and ensure that all validator functions are pass-throughs.repos/abstract-wiki/wikifunctions/function-orchestrator!51apineapine-no-static-validationmain
Customize query in GitLab

Event Timeline

bzimport raised the priority of this task from to High.Nov 21 2014, 11:35 PM
bzimport set Reference to bz29801.
bzimport added a subscriber: Unknown Object (MLST).

Created attachment 8766
Event listeners for #searchInput on enwiki

Attached:

Event_listeners_for_searchInput_on_enwiki.png (768×1 px, 195 KB)

I'd guess this has something to do with it:

fNode.parentNode.innerHTML = getID( id ).parentNode.innerHTML; // f***ing IE

in http://de.wiktionary.org/wiki/MediaWiki:If-search.js

This bit of code looks like it will cause the entire contents of the form to be removed and replaced with freshly-parsed HTML; the new nodes would no longer have any previously-connected event handlers if they had been set up directly on the dom nodes.

It's not used on de.wiktionary.org, which may indicate that it's obsolete and broken?

Adding Krinkle to CCs (last touched that if-search.js in February)

It may or may not be used on de.wikt but it's often ref'ed from there (kinda the central point)

(In reply to comment #4)

It may or may not be used on de.wikt but it's often ref'ed from there (kinda
the central point)

So can you fix them all by working on dewiki?

(In reply to comment #2)

I'd guess this has something to do with it:

fNode.parentNode.innerHTML = getID( id ).parentNode.innerHTML; // f***ing IE

in http://de.wiktionary.org/wiki/MediaWiki:If-search.js

I can confirm that after removing[1] this script from Portuguese Wikisource, both this bug and bug 29516 disappeared.

[1]https://secure.wikimedia.org/wikisource/pt/w/index.php?diff=231041&oldid=229953

(In reply to comment #7)

closing re comment #6

Ok, but could anyone take a look into the script to help us to fix it, since it seems to be used by other projects as well?