#336 Module:Shortcuts on de.wikipedia causes errors

v1.7.*
closed
nobody
scribunto (5)
v1.7.2
2014-07-14
2014-07-11
Anonymous
No

When you updated your copy of de.wikipedia to the latest version (from this month), and visit any page using the Module:Shortcuts (via Template:Shortcut), an error will be shown instead of the shortcut. E.g. on top of de.wikipedia.org/wiki/Wikipedia:Autorenportal there is "=Module:Shortcuts:213 attempt to index ? (a nil value)". Note that this also breaks the table layout. That module showed errors in the version from last month, too, but these probably were correct, as at that time the code was broken on Wikipedia, too. --Schnark

Discussion

  • gnosygnu
    gnosygnu
    2014-07-12

    • labels: --> scribunto
    • status: new --> done
    • Expected release: --> v1.7.2
    • Milestone: PFE --> v1.7.*
     
  • gnosygnu
    gnosygnu
    2014-07-12

    Thanks for picking that up! That's a bug that affects many pages in the Wikipedia / Portal namespace, though fortunately it wasn't worse.

    This is fixed for v1.7.2. More detail below if you're interested


    Module:Shortcut was calling GetContent to extract the shortcut from the redirect text. The problem was that XOWA automatically defaults to returning a redirect's target page. So Module:Shortcut was expecting "#WEITERLEITUNG [[Wikipedia:Autorenportal]]" for WP:ARP, but instead got the page text for Wikipedia:Autorenportal. Module:Shortcut then fails with the error above.

    I added logic to say that if the page is a redirect, return its source, not its target's source.

     
  • gnosygnu
    gnosygnu
    2014-07-12

    On a side note, I noticed that the Shortcuts link at the top of the page is unclickable. If you're curious, you can simulate the same by doing the following

    • Edit de.wikipedia.org/wiki/Wikipedia:Autorenportal
    • Delete the 1st line that says {{Shortcuts}}
    • Replace with the following: <div id="shortcut" class="shortcut">[[Wikipedia:Shortcuts|Abkürzung]]: WP:APO, WP:P</div>

    Now hover over the Abkürzung link. You'll notice it's not clickable, despite being an anchor.

    It turns out the problem is with search_suggest.js. It creates an <li> that has the same top of 1.5em as does the <div id=shortcut>.

    I fixed this for v1.7.2 by sprinkling "suggestionList.style.display = '';" and "suggestionList.style.display = 'none';" where necessary. If you're curious, you can review the attached .js

     
    Last edit: gnosygnu 2014-07-12
    Attachments


Anonymous


Cancel   Add attachments