Page MenuHomePhabricator

Remove logging from MobileFormatter#moveFirstParagraphBeforeInfobox
Closed, ResolvedPublic


On mobile we shift the lead paragraph above the infoboxes for readability reasons. This code relies on the assumption that the infobox element has no parents. It seems there are a significant amount of pages that break this assumption and thus are not rendering as well as they could do.

Logging has been limited to English Wikipedia to reduce the amount of events logged previously there were 200K log messages a day relating to this. Limiting to English drops this to 90K.

We would like to fix the underlying issues in templates (if possible) and then remove the logging altogether.


In T149884: Log instances of infoboxes being wrapped in containers (associated epic: T143139), we added logging to in MobileFormatter#moveFirstParagraphBeforeInfobox so that we could know if and where nested infoboxes were occurring on the Wikipedias.

Open Questions

  1. Is this logging still necessary? We have a good list defined in T162713: [spike 2hrs] Evaluate result of "Log instances of infoboxes being wrapped in containers" (T149884 ) and T163805: Adjustments to how we log troublesome infoboxes and move lead paragraph.

Analysis of problematic pages

English Wikipedia problems

Impacted pages:

Talk page:
Should be fixed but awaiting confirmation

  • Module:Infobox_military_conflict causes various problems

Impacted pages:

Talk page:

Other wikis: Musikalbum


Event Timeline

Change 361789 had a related patch set uploaded (by Jdlrobson; owner: Jdlrobson):
[operations/mediawiki-config@master] Disable logging from MobileFormatter#moveFirstParagraphBeforeInfobox

There's about 200K log messages a day relating to this (yikes).

We probably have enough data now to identify the problematic templates

I'd like to filter out known issues, but I don't think that's possible. Let me scan through the logs and see if I can find any problematic templates.


  1. remove this logging ASAP
  2. Analyse what we've found so far
  3. Find a general solution
  4. Turn logging back on to verify we've dropped the noise levels down

After talking to @kaldari, my plan is to limit logging to enwiki and actual tease out what the problematic templates are. Apparently the infobox wrapping is trying to get around a parser bug and @kaldari says there's a better fix. Once we've squashed the problems on enwiki I'll turn my attention to other wikis.

Ping @TheDJ looks like OJ Simpson is using the stack template on an infobox which is also causing problems as infoboxes ideally should not be wrapped (makes mobile styling/transformations a pain) - seems to be doing that. Any idea why and whether there is a nicer way we could do this?

Change 361789 merged by Chad:
[operations/mediawiki-config@master] Only enable logging on enwiki for MobileFormatter#moveFirstParagraphBeforeInfobox

Jdlrobson triaged this task as Medium priority.Jun 28 2017, 6:58 PM
Jdlrobson added subscribers: ovasileva, Nirzar.

Looks like the 30 day HTML cache is playing up here so I'm still seeing logged events, but we should have reduced the numbers by fixing the 2 problematic templates.

@ovasileva and @Nirzar: Certain pages wrap the .infobox element inside a .mw-stack element

For example:
(try on mobile screen - infobox comes first)

Do we want to move infoboxes which are wrapped in the mw-stack element below the lead paragraph? (if so let's create a new task)

This is likely to fix the remaining issues.
I think we can then remove all the logging...

ideally yes, but i'm guessing this is because of a template?

Yeh specifically the stack template which seems to be used to position elements correctly on mobile. @TheDJ may be able to possibly shed some light on why it is used but there is no way to fix this on wiki...

@Jdlrobson - I can open a task. Do we know how many templates are affected?

Jdlrobson changed the task status from Open to Stalled.Jul 7 2017, 6:06 PM

@ovasileva I created T170006. This task is stalled until we fix that or choose not to fix that...

Jdlrobson claimed this task.

I'm going to resolved this task. The remaining work is detailed in T170006 so it's not useful to keep this around.