Last modified: 2007-04-16 13:23:40 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 3366 - Skin::getSkinName not overridden in subclasses
Skin::getSkinName not overridden in subclasses
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Templates (Other open bugs)
1.6.x
PC Windows 2000
: Low minor (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2005-09-05 17:56 UTC by Erik Dokter
Modified: 2007-04-16 13:23 UTC (History)
0 users

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


Attachments

Description Erik Dokter 2005-09-05 17:56:19 UTC
Most skins use SkinTemplate as a base. In here, $this->skinname 
is marked private. However, some skins are based on Skin. In 
Skin, there's no such 'property'. 

Skin has a member function getSkinName(). This function returns 
the name of the skin, which defaults to 'standard'. This 
function should be overwritten by derived classes.

SkinTemplate is based on Skin. It does NOT overwrite the 
getSkinName() function, thus returning an incorrect skinname (i.
e., 'standard', instead of 'amethyst')

To ensure correct working of the code, there should be an $this-
>skinname in Skin.

Proposed fix:

In Skin::Skin(), add "$this->skinname = 'standard';"
Replace "return 'standard';" in Skin::getSkinName() with "return 
$this->skinname;"

After this, developers can use $skin->getSkinName() and it will 
return the correct skinname, regardless of its parentclass 
(SkinTemplate, Skin ).

Skins based on Skin have overwritten the getSkinName function. 
So those won't be affected.
Comment 1 Antoine "hashar" Musso (WMF) 2007-04-16 13:23:40 UTC
I applied your patch and marked Skin::skinname protected.

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


Navigation
Links