Last modified: 2013-07-25 07:06:52 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T43667, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 41667 - Wikibase Repo: Catchable fatal error: Argument 2 passed to Wikibase\RepoHooks::onPageContentLanguage() must be an instance of Language, string given
Wikibase Repo: Catchable fatal error: Argument 2 passed to Wikibase\RepoHooks...
Status: VERIFIED FIXED
Product: MediaWiki extensions
Classification: Unclassified
WikidataRepo (Other open bugs)
unspecified
All All
: High major (vote)
: ---
Assigned To: Wikidata bugs
:
: 41734 41739 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-11-01 23:19 UTC by Sam Reed (reedy)
Modified: 2013-07-25 07:06 UTC (History)
15 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Sam Reed (reedy) 2012-11-01 23:19:15 UTC
[01-Nov-2012 22:55:22] Catchable fatal error: Argument 2 passed to Wikibase\RepoHooks::onPageContentLanguage() must be an instance of Language, string given at /usr/local/apache/common-local/php-1.21wmf3/extensions/Wikibase/repo/Wikibase.hooks.php on line 153
Server: mw21
Method: GET
URL: http://www.wikidata.org/w/index.php?title=MediaWiki:Gadget-HotCatsMultiCustomEdit.js&action=raw&ctype=text/javascript
Backtrace:
#0 /usr/local/apache/common-local/php-1.21wmf3/extensions/Wikibase/repo/Wikibase.hooks.php(153): Wikibase\RepoHooks::onPageContentLanguage()
#1 [internal function]: Wikibase\RepoHooks::onPageContentLanguage(Object(Title), 'en', Object(StubUserLang))
#2 /usr/local/apache/common-local/php-1.21wmf3/includes/Hooks.php(253): call_user_func_array('Wikibase\RepoHo...', Array)
#3 /usr/local/apache/common-local/php-1.21wmf3/includes/GlobalFunctions.php(3819): Hooks::run('PageContentLang...', Array)
#4 /usr/local/apache/common-local/php-1.21wmf3/includes/Title.php(4706): wfRunHooks('PageContentLang...', Array)
#5 /usr/local/apache/common-local/php-1.21wmf3/includes/Title.php(3422): Title->getPageLanguage()
#6 /usr/local/apache/common-local/php-1.21wmf3/includes/Wiki.php(424): Title->getSquidURLs()
#7 /usr/local/apache/common-local/php-1.21wmf3/includes/Wiki.php(305): MediaWiki->performAction(Object(Article), Object(Title))
#8 /usr/local/apache/common-local/php-1.21wmf3/includes/Wiki.php(555): MediaWiki->performRequest()
#9 /usr/local/apache/common-local/php-1.21wmf3/includes/Wiki.php(448): MediaWiki->main()
#10 /usr/local/apache/common-local/php-1.21wmf3/index.php(59): MediaWiki->run()
#11 /usr/local/apache/common-local/live-1.5/index.php(3): require('/usr/local/apac...')
#12 {main}
Comment 1 Robin Pepermans (SPQRobin) 2012-11-02 18:37:47 UTC
I don't understand why this error occurs, since 'en' is always passed with wfGetLangObj() so it's always a Language object. The last commit changing the page language code was Gerrit change #22732, so it's strange that is only now discovered. But as far as I tested, this bug too is fixed with Gerrit change #30615.

So I guess it's best to backport that change to wmf3, since it fixes two major bugs.
Comment 2 jeblad 2012-11-03 15:27:22 UTC
Change Id52f4e5b: Fix for onPageContentLanguage
Comment 3 jeblad 2012-11-03 15:32:51 UTC
*** Bug 41739 has been marked as a duplicate of this bug. ***
Comment 4 Sam Reed (reedy) 2012-11-03 17:36:35 UTC
(In reply to comment #1)
> I don't understand why this error occurs, since 'en' is always passed with
> wfGetLangObj() so it's always a Language object. The last commit changing the
> page language code was Gerrit change #22732, so it's strange that is only now
> discovered. But as far as I tested, this bug too is fixed with gerrit change
> 30615.
> 
> So I guess it's best to backport that change to wmf3, since it fixes two major
> bugs.

30615 doesn't fix the issue. Backported and merged in https://gerrit.wikimedia.org/r/#/c/31651/
Comment 5 Robin Pepermans (SPQRobin) 2012-11-05 02:57:17 UTC
This is a very strange bug. Simplest way to fix it is to remove the Language next to the parameter. See my comment on Gerrit change #31650.
Comment 6 Daniel Kinzler 2012-11-05 10:05:56 UTC
I51dabe9a is related, might "accidentally" fix this.

Also: we could just ditch the entire hook function, EntityContent can just implement getPageLanguage directly. Thats probably cleaner anyway.
Comment 7 Daniel Kinzler 2012-11-05 11:32:10 UTC
*** Bug 41734 has been marked as a duplicate of this bug. ***
Comment 8 Daniel Kinzler 2012-11-05 13:03:54 UTC
Not sure when and why this happened exactly, one way would be another hook handler setting the value to a string (which is legal according to the documentation).

Anyway, Ia0ba6518 should fix this.
Comment 9 Robin Pepermans (SPQRobin) 2012-11-05 23:31:51 UTC
(In reply to comment #6)
> I51dabe9a is related, might "accidentally" fix this.

That is what I had said above too, but it didn't.

(In reply to comment #8)
> Not sure when and why this happened exactly, one way would be another hook
> handler setting the value to a string (which is legal according to the
> documentation).

I tested and did not find any way it got set to a string. As I said above, it is a very strange bug. Seems more like a bug in the hook system afaics.

> Anyway, Ia0ba6518 should fix this.

It does (although I don't like the solution of a difference between the page content and page view language, but that's discussion for Gerrit change #31361).

So probably best to backport Ia0ba6518 to get it fixed on the live wikidata ;-)

Marking the bug as fixed.
Comment 10 Aude 2012-11-06 14:31:26 UTC
Disabling use of PageContentLanguage hook in the wikidata-wmfphase1beta branch in deployment.  This should fix the bug for what's in deployment now.

https://gerrit.wikimedia.org/r/#/c/32042/

0.2 branch and master should have a different, less hacky fix.
Comment 11 Daniel Kinzler 2012-11-06 15:24:46 UTC
(In reply to comment #10)
> 0.2 branch and master should have a different, less hacky fix.

Actually, that fix is pretty much the same: remove the hook function (and unregister it, of course). We don't need it, because EntityContent is implementing getPageViewLanguage and (then also) getPageLanguage directly.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links