Page MenuHomePhabricator

TypeError: baseHref is undefined on wikidata.org search
Closed, ResolvedPublic

Description

This is showing up in production logs in wikidata.org on Vector. Possibly relates to T217726 ?

at getFormData URL1:17:501
at specialRenderFunction URL1:19:915
at special/< URL1:4:843

URL1: https://www.wikidata.org/w/load.php?lang=en&modules=jquery.highlightText%2Csuggestions%7Cmediawiki.searchSuggest&skin=vector&version=1rlio

https://logstash.wikimedia.org/app/kibana#/doc/logstash-*/logstash-2020.10.26/clienterror/?id=AXVmT4KK2lgCwKx7OEF0

Event Timeline

https://gerrit.wikimedia.org/g/mediawiki/core/+/7f28fe35b81e8614ab2bb40e6125a4e3a33ad794/resources/src/mediawiki.searchSuggest/searchSuggest.js#74

baseHref is set by $form.attr( 'action' ), not sure why it can fail on wikidata.org, because it looks core function used here

Maybe this is not the search form on every page view? It may be a search form on a special page not set up correctly. It is possible to get a page name from there the error is coming?

Change 670558 had a related patch set uploaded (by Jdlrobson; owner: Jdlrobson):
[mediawiki/core@master] Defensively program for action attribute

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

I can replicate this by running the code $('#searchform').removeAttr('action') and focusing the search area. We run gadgets so highly likely a gadget is doing that. Some defensive programming is low cost and will avoid this error.

Change 670558 merged by jenkins-bot:
[mediawiki/core@master] Defensively program for action attribute

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

Jdlrobson claimed this task.

Will reopen next thursday if persisting