Page MenuHomePhabricator

Infobox template parameters showing in Hovercard
Closed, ResolvedPublic

Description

A hovercard for a link to https://de.wikipedia.org/wiki/University_of_Cambridge currently just shows 2 parameters (unused) in the infobox.

You can test it at (3rd paragraph) https://de.wikipedia.org/wiki/Douglas_Adams#Leben

Hovering over the link for University of Cambridge shows "Vorlage:Infobox Hochschule/Mitarbeiter fehlt"

Screenshot from 2015-08-21 09:16:39.png (590×952 px, 400 KB)

Event Timeline

Quiddity raised the priority of this task from to Needs Triage.
Quiddity updated the task description. (Show Details)
Quiddity subscribed.
Jdlrobson updated the task description. (Show Details)
Jdlrobson set Security to None.

This is because the German Wikipedia template "Infobox Hochschule" explicitly outputs weird invisible text as part of the wiki page. Whatever this is for, I don't think it's reasonable to expect this kind of hack to be supported.

<div id="mw-content-text" lang="de" ...>
 <p>
  <span style="display: none;"><a href="/..redlink=1">Vorlage:Infobox Hochschule/Mitarbeiter fehlt</a></span>
  <span style="display: none;"><a href="/..redlink=1">Vorlage:Infobox Hochschule/Professoren fehlt</a></span>
 </p>
<table .. summary="Infobox Hochschule">
  ..
 </table>
<p>Die <b>University of Cambridge</b>.. im Vereinigten Königreich..

If I understand it correctly, the infobox "does not show" a link to various templates ([[Vorlage:Infobox Hochschule/Mitarbeiter fehlt]], [[Vorlage:Infobox Hochschule/Logo fehlt]]), possibly as a way to track the pages with missing data through WhatLinksHere.

Would replacing those templates with (hidden) categories solve this issue, or are categories also shown in the hovercards?

If I understand it correctly, the infobox "does not show" a link to various templates ([[Vorlage:Infobox Hochschule/Mitarbeiter fehlt]], [[Vorlage:Infobox Hochschule/Logo fehlt]]), possibly as a way to track the pages with missing data through WhatLinksHere.

Would replacing those templates with (hidden) categories solve this issue, or are categories also shown in the hovercards?

Yes, it would solve the issue. This isn't really an issue with Hovercards, it's an issue with the template code outputting stuff badly. Hidden categories are probably better practice for static error strings. For dynamic ones, adding class="error" to each of the spans would also solve the problem (since TextExtracts ignores that class). I've recently solved a few instances of the latter that way on English Wikipedia.

Hovercards can't deal with badly-formatted pages, and that's not a bug. In some cases, the pages, rather than the code, ought to be fixed. I know I've done my share fixing hundreds of pages with non-standard hatnotes (using :'' instead of {{about}} and such), which also produce bad Hovercard output.