Page MenuHomePhabricator

DocBookExport: Fails for pages containing thumbnails
Closed, ResolvedPublic

Description

When a page contains a thumbnail instead of a fullsize image, wfFindFile will not find the file in \DocBookExportAPI::getDocbookfromWikiPage, returning false.
As there is no check for that case, calling getLocalRefPath() on its return path will fail.

Here is the stack trace:

/w/api.php?action=getdocbook&outputformat=pdf&bookname=Test Error from line 326 of /var/www/html/w/extensions/DocBookExport/DocBookExportAPI.php: Call to a member function getLocalRefPath() on boolean
Backtrace:
#0 /var/www/html/w/extensions/DocBookExport/DocBookExportAPI.php(71): DocBookExportAPI->getDocbookfromWikiPage(string, ParserOptions, string, array, array)
#1 /var/www/html/w/includes/api/ApiMain.php(1583): DocBookExportAPI->execute()
#2 /var/www/html/w/includes/api/ApiMain.php(546): ApiMain->executeAction()
#3 /var/www/html/w/includes/api/ApiMain.php(517): ApiMain->executeActionWithErrorHandling()
#4 /var/www/html/w/api.php(94): ApiMain->execute()
#5 {main}

Event Timeline

Foxtrott created this task.Jun 8 2018, 6:17 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJun 8 2018, 6:17 PM
Vvjjkkii renamed this task from DocBookExport: Fails for pages containing thumbnails to pdbaaaaaaa.Jul 1 2018, 1:05 AM
Vvjjkkii removed Nischayn22 as the assignee of this task.
Vvjjkkii triaged this task as High priority.
Vvjjkkii updated the task description. (Show Details)
Vvjjkkii edited subscribers, added: Nischayn22; removed: Aklapper.
CommunityTechBot renamed this task from pdbaaaaaaa to DocBookExport: Fails for pages containing thumbnails.Jul 2 2018, 3:06 PM
CommunityTechBot assigned this task to Nischayn22.
CommunityTechBot raised the priority of this task from High to Needs Triage.
CommunityTechBot updated the task description. (Show Details)
CommunityTechBot edited subscribers, added: Aklapper; removed: Nischayn22.

Change 530698 had a related patch set uploaded (by Nischayn22; owner: Nischayn22):
[mediawiki/extensions/DocBookExport@master] Fix for T196762

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

Change 530698 merged by Nischayn22:
[mediawiki/extensions/DocBookExport@master] Fix for T196762

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

Nischayn22 closed this task as Resolved.Aug 17 2019, 2:42 PM

Thanks for this bug report.