Page MenuHomePhabricator

Unable to export if ws-cover refers to a non-existant file
Closed, ResolvedPublicBUG REPORT

Description

Exporting e.g. https://en.wikisource.org/wiki/Keeban_(Little,_Brown_and_Company) which has | cover = Keeban cover.jpg results in:

$ ./bin/console a:e -l en -t 'Keeban_(Little,_Brown_and_Company)'
In BookProvider.php line 305:
  [ErrorException]                          
  Warning: Undefined array key "imageinfo"  
Exception trace:
  at src/BookProvider.php:305
 App\BookProvider->getCover() at src/BookProvider.php:112
 App\BookProvider->getMetadata() at src/BookProvider.php:48
 App\BookProvider->get() at src/BookCreator.php:49

This is because the cover image is actually Keeban_cover.png, but the template outputs <span id="ws-cover">Keeban cover.jpg</span>.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Another example of a similar error: https://ws-export.wmcloud.org/?format=epub&lang=ca&page=Llibre:Un_Casament_en_Picaña.pdf for https://ca.wikisource.org/wiki/Llibre:Un_Casament_en_Picaña.pdf (lots of these in the error logs).

"class": "InvalidArgumentException",
"message": "URI must be a string or UriInterface",
"code": 0,
"file": "/var/www/tool/vendor/guzzlehttp/psr7/src/Utils.php:461",
"trace": [
    "/var/www/tool/vendor/guzzlehttp/guzzle/src/Client.php:161",
    "/var/www/tool/vendor/guzzlehttp/guzzle/src/ClientTrait.php:159",
    "/var/www/tool/src/BookProvider.php:229",
    "/var/www/tool/vendor/guzzlehttp/guzzle/src/Pool.php:60",
    "/var/www/tool/vendor/guzzlehttp/promises/src/EachPromise.php:85",
    "/var/www/tool/vendor/guzzlehttp/guzzle/src/Pool.php:75",
    "/var/www/tool/src/BookProvider.php:252",
    "/var/www/tool/src/BookProvider.php:170",
    "/var/www/tool/src/BookProvider.php:48",
    "/var/www/tool/src/BookCreator.php:49",
    "/var/www/tool/src/Controller/ExportController.php:157",
    "/var/www/tool/src/Controller/ExportController.php:105",
Samwilson claimed this task.

Fixed and deployed with 2.13.6.