Page MenuHomePhabricator

PHP 7.1 throws a warning for TranslateToolbox::toolboxAllTranslations(), hence migrate to new hook
Closed, ResolvedPublic

Description

I have noticed in the logs that the following warning is thrown, (nothing is broken)

PHP Warning: Parameter 1 to TranslateToolbox::toolboxAllTranslations() expected to be a reference, value given in /var/www/html/includes/Hooks.php on line 186

To reproduce

  1. Install MediaWiki
  2. Make sure that you are on PHP 7.1
  3. Install Translate
  4. Check the Error log

This should be migrated to BaseTemplateToolbox.


MediaWiki 1.29.1
PHP 7.1
Latest version of Translate

Event Timeline

It seems to always be called with a reference, not sure why the warning. In any case it should likely be migrated to BaseTemplateToolbox.

Just removing the & is one character change to get rid of the warning, which would be too easy. I need to check how the new hook works to see if it is not too complicated.

I checked, migrating to the new hook should be a nice GCI task.

Aklapper renamed this task from PHP 7.1 throws a warning for translate to PHP 7.1 throws a warning for TranslateToolbox::toolboxAllTranslations(), hence migrate to new hook.Nov 25 2017, 8:26 PM
Aklapper updated the task description. (Show Details)
nikitavbv subscribed.

I will work on fixing this

Unluckily, I have problems with reproducing this issue. I am using PHP 7.1, but I don't get that warning in the log. Does it occur on some specific page / after some action?

Change 394029 had a related patch set uploaded (by Phantom42; owner: Phantom42):
[mediawiki/extensions/Translate@master] Migrate to BaseTemplateToolbox hook

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

I am done with migrating SkinTemplateToolboxEnd hook to BaseTemplateToolbox

Change 394029 merged by jenkins-bot:
[mediawiki/extensions/Translate@master] Migrate to BaseTemplateToolbox hook

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