(bug 41337) Fix fatal error in Special:Preferences
authorAlexandre Emsenhuber <ialex.wiki@gmail.com>
Thu, 1 Nov 2012 21:07:37 +0000 (22:07 +0100)
committerAntoine Musso <hashar@free.fr>
Wed, 15 May 2013 08:47:43 +0000 (10:47 +0200)
commit307eee22b6cfc8354e9fb746a3fb9cfe9c9dc041
treecfd9ef85026392c1ebe7baceb43c957cf198e38c
parentf3de84430d8e569d9de9302f1855139edb28df03
(bug 41337) Fix fatal error in Special:Preferences

The error is Fatal error: Call to a member function msg() on a
non-object at includes/Preferences.php on line 1207.

The problem is that fields created in Preferences::getPreferences() for
validation don't have their parent set and thus an error occurs when the
validation fails since they want to use their parent to get a Message
object.

This commit adds a dummy parent object to these fields to fix the error.

bug: 41337
Change-Id: I5826d6e3f1262c8d26af0cfe7074a939f80bcaca
includes/Preferences.php
tests/phpunit/includes/specials/SpecialPreferencesTest.php [new file with mode: 0644]