Last modified: 2012-06-22 12:24:36 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 T39760, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 37760 - Attempting to translate a page into a non-permitted language results in 500 error rather than clean error
Attempting to translate a page into a non-permitted language results in 500 e...
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
Translate (Other open bugs)
master
All All
: High major (vote)
: ---
Assigned To: Niklas Laxström
: code-update-regression
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-06-20 23:07 UTC by Rob Redpath
Modified: 2012-06-22 12:24 UTC (History)
2 users (show)

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


Attachments

Description Rob Redpath 2012-06-20 23:07:28 UTC
I'm running MediaWiki 1.19.1, just done a fresh pull of Translate from git, master branch. My apologies for any inaccuracies in terminology - I'm very new to MediaWiki, a little rusty with PHP but use git daily. 

How to recreate:-

Set up a user account with 'en' as its language
Create a page, in English, and mark it for translation into German only (by setting 'de' as a priority translation and checking 'disallow translation into other languages'. 
Click 'Translate this page'. 

A 500 error will be returned, and this placed into the logs:-

[Wed Jun 20 23:07:59 2012] [error] [client xx.xx.xx.xx] PHP Fatal error:  Call to undefined method Language::fetchLanguageName() in /home/sites/mysite.com/public_html/wiki/extensions/Translate/specials/SpecialTranslate.php on line 163, referer: http://wiki.mysite.com/index.php?title=XX_XX_XX

-: the page requested was :-

http://wiki.mysite.com/index.php?title=Special%3ATranslate&taction=translate&group=page-XX+XX+XX&language=en&limit=100&task=view

By changing the language GET param to 'de', the page displays properly. 

I believe this bug was introduced in commit 76cd8533, as checking out the commit prior to this results in a sane error message being displayed. 

I'm happy to grant access to my install to developers if the bug can't be recreated on a test env.
Comment 1 Niklas Laxström 2012-06-21 10:51:03 UTC
Patch in review https://gerrit.wikimedia.org/r/12355
Comment 2 Rob Redpath 2012-06-21 16:52:31 UTC
Just checked out latest master in git - issue isn't resolved. 

I may have my logic completely wrong, but it looks like there's no function called fetchLanguageName defined anywhere:-

[mysite.com@mywebserver wiki]$ pwd
/home/sites/mysite.com/public_html/wiki
[mysite.com@mywebserver wiki]$ grep -r fetchLanguage .
./extensions/Translate/specials/SpecialTranslate.php:                                           Language::fetchLanguageName( $this->options['language'], $wgLang->getCode() ),
./extensions/Translate/TranslateUtils.php:              if ( is_callable( array( 'Language', 'fetchLanguageNames' ) ) ) {
./extensions/Translate/TranslateUtils.php:                      $languageNames = Language::fetchLanguageNames( $code, 'mw' ); // since 1.20
Comment 3 Niklas Laxström 2012-06-22 08:14:14 UTC
The patch was probably not merged at that time. Please try again.
Comment 4 Rob Redpath 2012-06-22 08:59:36 UTC
The checkout that I had included commit c37971fe, which appeared to be the merged patch. I've just checked out latest (last commit 940517c8) and the bug still exists.
Comment 5 Niklas Laxström 2012-06-22 11:51:49 UTC
You are right, I missed one instance. https://gerrit.wikimedia.org/r/12584 submitted.
Comment 6 Siebrand Mazeland 2012-06-22 12:16:36 UTC
Merged.
Comment 7 Rob Redpath 2012-06-22 12:24:36 UTC
Confirmed fixed :) Thanks!

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


Navigation
Links