Page MenuHomePhabricator

Passing a raw class name is not allowed here. Use [ 'class' => $classname ] instead.
Open, In Progress, MediumPublicBUG REPORT

Description

NOTE: This happens for MediaWiki 1.35 when you try to move pages that have the translate tag but are not marked for translation. Ugly workaround: Mark the page for translation and move the page.

Setup

  • MediaWiki 1.35.4 (10bc2a1) 01:46, 25. Okt. 2021
  • PHP 7.3.31-1~deb10u1 (apache2handler)
  • MariaDB 10.3.31-MariaDB-0+deb10u1
  • Translate 2021-11-18 MLEB 2021.11 (6289cb7) 12:53, 28. Okt. 2021

Issue
When trying to move a page I get the following exception:

ba4f44df7339ab18c6f784bd] /whn/Spezial:Verschieben/MediaWiki_1.37.0 InvalidArgumentException from line 230 of /.../w/vendor/wikimedia/object-factory/src/ObjectFactory.php: Passing a raw class name is not allowed here. Use [ 'class' => $classname ] instead.

After commenting the Translate extension this error no longer happens.

This issue sounds similar to T250582 though I did not make the effort back then to track down the cause, i.e. it is speculation to think it may also have been cause by Translate.

Backtrace

#0 /../w/vendor/wikimedia/object-factory/src/ObjectFactory.php(131): Wikimedia\ObjectFactory::validateSpec(string, array)
#1 /../w/vendor/wikimedia/object-factory/src/ObjectFactory.php(102): Wikimedia\ObjectFactory::getObjectFromSpec(string, array)
#2 /../w/extensions/Translate/src/PageTranslation/MoveTranslatablePageSpecialPage.php(153): Wikimedia\ObjectFactory->createObject(string)
#3 /../w/includes/specialpage/SpecialPage.php(600): MediaWiki\Extension\Translate\PageTranslation\MoveTranslatablePageSpecialPage->execute(string)
#4 /../w/includes/specialpage/SpecialPageFactory.php(635): SpecialPage->run(string)
#5 /../w/includes/MediaWiki.php(307): MediaWiki\SpecialPage\SpecialPageFactory->executePath(Title, RequestContext)
#6 /../w/includes/MediaWiki.php(940): MediaWiki->performRequest()
#7 /../w/includes/MediaWiki.php(543): MediaWiki->main()
#8 /../w/index.php(53): MediaWiki->run()
#9 /../w/index.php(46): wfIndexMain()
#10 {main}

Event Timeline

abi_ changed the task status from Open to In Progress.EditedThu, Nov 25, 2:44 PM
abi_ claimed this task.
abi_ triaged this task as Medium priority.
abi_ added a subscriber: abi_.

I was able to reproduce this with MW 1.35 and the latest code on the master branch.

Steps to reproduce:

  1. Create a translatable page but do not mark it for translation
  2. Try to move the page

Ugly workaround:

To circumvent this issue, mark the page for translation before trying to move it

Change 741928 had a related patch set uploaded (by Abijeet Patro; author: Abijeet Patro):

[mediawiki/extensions/Translate@master] MoveTranslatablePageSpecialPage: movePageSpec is string for MW < 1.36

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

abi_ updated the task description. (Show Details)

@abi_ Thanks a bunch for dealing this this. Much appreciated.

Note about steps to reproduce:

Create a translatable page but do not mark it for translation

On my wiki the respective page contained any syntax provided by the translate extension. This happens on any page.

@abi_ Thanks a bunch for dealing this this. Much appreciated.

Note about steps to reproduce:

Create a translatable page but do not mark it for translation

On my wiki the respective page contained any syntax provided by the translate extension. This happens on any page.

You are right, my bad. This will happen for all pages that have not been marked for translation. I've updated my comments.

My patch should fix the issue. We will review and release another version of MLEB.

No worries. Thanks a lot for your swift effort which I appreciate a lot.

Change 741928 merged by jenkins-bot:

[mediawiki/extensions/Translate@master] MoveTranslatablePageSpecialPage: movePageSpec is string for MW < 1.36

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

Change 742911 had a related patch set uploaded (by Abijeet Patro; author: Abijeet Patro):

[mediawiki/extensions/Translate@mleb-2021.12] MoveTranslatablePageSpecialPage: movePageSpec is string for MW < 1.36

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

Change 742911 merged by jenkins-bot:

[mediawiki/extensions/Translate@mleb-2021.12] MoveTranslatablePageSpecialPage: movePageSpec is string for MW < 1.36

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