Page MenuHomePhabricator

Search throws error if any matches are redirects to non-existent articles
Closed, ResolvedPublic

Description

On my local wiki, if I search for ‘A’, ‘D’, or ‘E’ it works fine, but if I search for ‘B’, ‘C’, or ‘F’ it fails and throws the following JS error:
"TypeError: mw.Title is undefined"

This comes from line 145 in SearchApi::search():
mwTitle = mw.Title.newFromText( page.title, self._searchNamespace );

Event Timeline

kaldari raised the priority of this task from to Needs Triage.
kaldari updated the task description. (Show Details)
kaldari added a project: Readers-Web-Backlog.
kaldari added a subscriber: kaldari.
kaldari renamed this task from Search from non-existent pages is broken to Searches for certain strings throw JS error.Feb 13 2015, 7:46 PM
kaldari updated the task description. (Show Details)
kaldari set Security to None.

Seems to be caused by some of the search results being redirects to non-existent pages.

gerritbot added a subscriber: gerritbot.

Change 190505 had a related patch set uploaded (by Kaldari):
Prevent search from throwing error for redirects to non-existant articles

https://gerrit.wikimedia.org/r/190505

Patch-For-Review

kaldari renamed this task from Searches for certain strings throw JS error to Search throws error if any matches are redirects to non-existent articles.Feb 13 2015, 8:26 PM
kaldari updated the task description. (Show Details)
Florian claimed this task.

Change 190505 merged by jenkins-bot:
Prevent search from throwing error for redirects to non-existant articles

https://gerrit.wikimedia.org/r/190505