Last modified: 2007-04-16 13:23:40 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 T5366, the corresponding Phabricator task for complete and up-to-date bug report information.
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