Page MenuHomePhabricator

Mpdf extension fails PHP 7.0 lint
Closed, ResolvedPublic

Description

https://integration.wikimedia.org/ci/job/mwext-testextension-php70-jessie-non-voting/684/console

km@km-pt ~/g/m/c/e/Mpdf> php -l mpdf/classes/svg.php 
PHP Fatal error:  'break' not in the 'loop' or 'switch' context in mpdf/classes/svg.php on line 2416
Errors parsing mpdf/classes/svg.php

Example:

Parse error: ./mpdf/classes/svg.php:2416
    2414| 				}
    2415| 				else if (strtolower($name) == 'stop'){
  > 2416| 						if (!$last_gradid) break;
    2417| 						if (isset($attribs['style']) AND preg_match('/stop-color:\s*([^;]*)/i',$attribs['style'],$m)) {
    2418| 							$color = trim($m[1]);
'break' not in the 'loop' or 'switch' context in ./mpdf/classes/svg.php on line 2416

Details

Related Gerrit Patches:
mediawiki/extensions/Mpdf : masterAdd extension.json file and use composer for Mpdf library ver 6.1 (v0.9)
integration/config : masterMigrate Mpdf to Quibble
integration/config : masterSwitch Mpdf to use composer

Event Timeline

Legoktm created this task.Feb 28 2018, 4:26 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptFeb 28 2018, 4:26 PM

It appears this is a locally modified copy of https://github.com/mpdf/mpdf - I'm not sure whether we should be patching it or just updating to a newer upstream version...

+cc @Pastakhov as the author.

Jdforrester-WMF added a subscriber: Jdforrester-WMF.

PhpTags isn't a Wikimedia-deployed extension.

hashar updated the task description. (Show Details)May 1 2018, 7:50 PM

It appears this is a locally modified copy of https://github.com/mpdf/mpdf - I'm not sure whether we should be patching it or just updating to a newer upstream version...
+cc @Pastakhov as the author.

I sent an email to pastakhov and his reply on May 13, 2018 was that he is very busy and "I'll try to update to a newer upstream version in a week [...] I hope that the error was fixed there." I don't see updates in GitHub yet ("Latest commit 8c271ce on Oct 23, 2017").

I think it implies that we should consider archiving what's in https://gerrit.wikimedia.org/r/#/admin/projects/mediawiki/extensions/Mpdf and make https://www.mediawiki.org/wiki/Extension:Mpdf point to GitHub instead?

Oh, sorry for delay, I try to update it right now

Change 435971 had a related patch set uploaded (by Hashar; owner: Pastakhov):
[mediawiki/extensions/Mpdf@master] Add extension.json file and use composer for Mpdf library ver 6.1 (v0.9)

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

Change 440094 had a related patch set uploaded (by Hashar; owner: Hashar):
[integration/config@master] Switch Mpdf to use composer

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

Change 440094 merged by jenkins-bot:
[integration/config@master] Switch Mpdf to use composer

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

Change 440103 had a related patch set uploaded (by Hashar; owner: Hashar):
[integration/config@master] Migrate Mpdf to Quibble

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

Change 440103 merged by jenkins-bot:
[integration/config@master] Migrate Mpdf to Quibble

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

Change 435971 merged by jenkins-bot:
[mediawiki/extensions/Mpdf@master] Add extension.json file and use composer for Mpdf library ver 6.1 (v0.9)

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

hashar closed this task as Resolved.Jun 19 2018, 2:58 PM
hashar assigned this task to Pastakhov.
hashar added a subscriber: hashar.

Fixed in mater by Pavel. Might want to backport the patch to REL1_31 :]