Warning: min(): Array must contain at least one element in ApiQueryTranslatorStats
Closed, ResolvedPublic

Description

Spotted in production: Warning: min(): Array must contain at least one element in /srv/mediawiki/php-1.31.0-wmf.5/extensions/ContentTranslation/api/ApiQueryTranslatorStats.php on line 57

demon created this task.Nov 1 2017, 5:46 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptNov 1 2017, 5:46 PM
Nikerabbit added subscribers: Petar.petkovic, Nikerabbit.

@Petar.petkovic I believe this is coming from your patch. Want to have a look at it?

Change 388033 had a related patch set uploaded (by Petar.petkovic; owner: Petar.petkovic):
[mediawiki/extensions/ContentTranslation@master] Fix PHP warning for min() method

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

Petar.petkovic moved this task from Backlog to In Review on the Language-2017-Oct-Dec board.
demon added a comment.Nov 2 2017, 7:33 PM

Dunno if these two are related or not:

  • Notice: Undefined property: ApiQueryContentTranslation::$user in /srv/mediawiki/php-1.31.0-wmf.6/extensions/ContentTranslation/api/ApiQueryContentTranslation.php on line 120
  • Notice: Undefined variable: translation in /srv/mediawiki/php-1.31.0-wmf.6/extensions/ContentTranslation/api/ApiQueryContentTranslation.php on line 126

Dunno if these two are related or not:

  • Notice: Undefined property: ApiQueryContentTranslation::$user in /srv/mediawiki/php-1.31.0-wmf.6/extensions/ContentTranslation/api/ApiQueryContentTranslation.php on line 120
  • Notice: Undefined variable: translation in /srv/mediawiki/php-1.31.0-wmf.6/extensions/ContentTranslation/api/ApiQueryContentTranslation.php on line 126

Those two "Notices" are related to each other and one problem causes both of them to appear, but aren't related to the warning originally reported in the description of this ticket.
Two of those are introduced in this patch. @santhosh, please take a look at this.

Dunno if these two are related or not:

  • Notice: Undefined property: ApiQueryContentTranslation::$user in /srv/mediawiki/php-1.31.0-wmf.6/extensions/ContentTranslation/api/ApiQueryContentTranslation.php on line 120
  • Notice: Undefined variable: translation in /srv/mediawiki/php-1.31.0-wmf.6/extensions/ContentTranslation/api/ApiQueryContentTranslation.php on line 126

Fixed in https://gerrit.wikimedia.org/r/388388 ApiQueryContentTranslation: Fix php warnings

Change 388033 merged by jenkins-bot:
[mediawiki/extensions/ContentTranslation@master] Fix PHP warning for min() method

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

Change 388460 had a related patch set uploaded (by Chad; owner: Petar.petkovic):
[mediawiki/extensions/ContentTranslation@wmf/1.31.0-wmf.6] Fix PHP warning for min() method

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

Change 388460 merged by jenkins-bot:
[mediawiki/extensions/ContentTranslation@wmf/1.31.0-wmf.6] Fix PHP warning for min() method

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

demon added a comment.Nov 3 2017, 4:08 PM

Fix for min() is live and looks good! Just waiting on the second one to merge

Checked in wmf.6 - no issues found.

Etonkovidova closed this task as Resolved.Nov 9 2017, 7:59 PM
Nikerabbit moved this task from QA to Done on the Language-2017-Oct-Dec board.