Page MenuHomePhabricator

PageImages no longer updating on stubs
Closed, ResolvedPublicBUG REPORT

Description

It seems that a page image is not being generated for articles which are stubs e.g. have no subheadings. Not sure if this is a recent regression or existing behaviour that has never been documented.

List of steps to reproduce (step by step, including full links if applicable):

  • Create an article with the following text:
Testss!!!s 
[[File:Tales serial.jpg]] [[File:Tales serial.jpg]]
[[test]] [[test2]] [[test3]]
  • ?action=info

Expected: page image present
Actual: no page image present

Add a section to the article e.g.

Testss!!!s 
[[File:Tales serial.jpg]] [[File:Tales serial.jpg]]
[[test]] [[test2]] [[test3]]

== Test ==
Text

Expected: page image present
Actual: page image present

Related Objects

Event Timeline

Looks like a regression from https://gerrit.wikimedia.org/r/c/mediawiki/extensions/PageImages/+/743062

The new code searchs for the first editsection. When no section is found, the return from strstr is false.
The old code used Content::getSection, which calls out to Parser::getSection -> Parser::extractSections which ends up to return the whole text for section 0, if no section exists.

Change 756182 had a related patch set uploaded (by Tim Starling; author: Tim Starling):

[mediawiki/extensions/PageImages@master] Fix the case where there are no section headers

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

Change 756183 had a related patch set uploaded (by Tim Starling; author: Tim Starling):

[mediawiki/extensions/PageImages@master] Add more integrated parser test

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

Change 756182 merged by jenkins-bot:

[mediawiki/extensions/PageImages@master] Fix the case where there are no section headers

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

Change 756183 merged by jenkins-bot:

[mediawiki/extensions/PageImages@master] Add more integrated parser test

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