Hello Folks,
I hope someone can help with a 1.23.8 to MW 1.24 upgrade and a custom skin I am trying to convert. It is a very basic custom skin based on Vector I "authored" a while ago, but without a proper understanding and with lots of help from this list.
I get no output (blank) and I see the log says it is due to a skin error.
Looking through the release notes, I see the problem will be down to the skin "auto-discovery" changes. Looking at the help page about migrating skins to 1.24 :
https://www.mediawiki.org/wiki/Manual:Skin_autodiscovery
I have tried to adjust my custom skin files but without success. In 1.24.1 skins/ I have :
CologneBlue/ Modern/ MonoBook/ README Vector/ ZedDocs/
ZedDocs is the custom skin based on Vector.
The Apache error I get is :
Tue Jan 13 15:43:10 2015] [error] [client 192.168.0.124] PHP Warning: require_once(/home/user/mediawiki-1.24.1/skins/zeddocs/../Vector.php): failed to open stream: No such file or directory in /home/user/mediawiki-1.24.1/skins/zeddocs/ZedDocs.skin.php on line 9, referer: http://wpdev/w/index.php?title=Main_Page
On line 9 of zeddocs/ZedDocs.skin.php I have/had :
require_once( dirname( __FILE__ ) . '/../Vector.php' );
If I set this to :
require_once( dirname( __FILE__ ) . '/../Vector/Vector.php' );
I get error :
[Tue Jan 13 16:38:50 2015] [error] [client 192.168.0.124] PHP Catchable fatal error: Argument 1 passed to SkinVector::__construct() must implement interface Config, string given, called in /home/user/mediawiki-1.24.1/includes/Setup.php on line 285 and defined in /home/user/mediawiki-1.24.1/skins/Vector/SkinVector.php on line 38, referer: http://wpdev/w/index.php?title=Main_Page
I have tried to set up my skin files (and renamed as CamelCase) as per the Skin_autodiscovery manual page.
skins/ZedDocs/ - css - images - ZedDocs.i18n.php - ZedDocs.php - ZedDocs.skin.php
I have made changes to files ZedDocs.php and ZedDocs.Skin.pnp, please see the attached PHP files. I have added a .txt extension for the list (just in case).
Can someone have a look and see where I am going wrong?
Many Thanks,
Alastair
On 2015-01-13 8:50 AM, Alastair Sherringham wrote:
The Apache error I get is :
Tue Jan 13 15:43:10 2015] [error] [client 192.168.0.124] PHP Warning: require_once(/home/user/mediawiki-1.24.1/skins/zeddocs/../Vector.php): failed to open stream: No such file or directory in /home/user/mediawiki-1.24.1/skins/zeddocs/ZedDocs.skin.php on line 9, referer: http://wpdev/w/index.php?title=Main_Page
On line 9 of zeddocs/ZedDocs.skin.php I have/had :
require_once( dirname( __FILE__ ) . '/../Vector.php' );
If I set this to :
require_once( dirname( __FILE__ ) . '/../Vector/Vector.php' );
This import line was meant to import the SkinVector and VectorTemplate classes, but those are in something like Vector.skin.php not Vector.php. However skin classes are now autoloaded (they weren't under the autodiscovery method), so the line is actually pointless now and all you do is remove it.
I get error :
[Tue Jan 13 16:38:50 2015] [error] [client 192.168.0.124] PHP Catchable fatal error: Argument 1 passed to SkinVector::__construct() must implement interface Config, string given, called in /home/user/mediawiki-1.24.1/includes/Setup.php on line 285 and defined in /home/user/mediawiki-1.24.1/skins/Vector/SkinVector.php on line 38, referer: http://wpdev/w/index.php?title=Main_Page
Someone messed with the way Vector is loaded, which is now like this:
// Register skin SkinFactory::getDefaultInstance()->register( 'vector', 'Vector', function(){ $config = ConfigFactory::getDefaultInstance()->makeConfig( 'vector' ); return new SkinVector( $config ); } );
// Register config $GLOBALS['wgConfigRegistry']['vector'] = 'GlobalVarConfig::newInstance';
You'll need to adapt is for your skin since SkinVector expects one of these config objects.
~Daniel Friesen (Dantman, Nadir-Seen-Fire) [http://danielfriesen.name/]
On Tue, Jan 13, 2015, at 05:04 PM, Daniel Friesen wrote:
Someone messed with the way Vector is loaded, which is now like this:
// Register skin SkinFactory::getDefaultInstance()->register( 'vector', 'Vector', function(){ $config = ConfigFactory::getDefaultInstance()->makeConfig( 'vector' ); return new SkinVector( $config ); } );
// Register config $GLOBALS['wgConfigRegistry']['vector'] = 'GlobalVarConfig::newInstance';
You'll need to adapt is for your skin since SkinVector expects one of these config objects.
Thanks Daniel,
If I remove the "require_once( dirname( __FILE__ ).." line from ZedDocs.skin.php I get the error :
"PHP Catchable fatal error: Argument 1 passed to SkinVector::__construct() must implement interface Config, string given ..."
which is why/where I need to fix-up my skin I assume.
Unfortunately, I have no idea how to do this at the moment, so hope it is not hard. Given my skin is very basic and small (most of the ZedDocs.skin.php file seems to be "template" stuff?), is it straightforward?
Cheers,
mediawiki-l@lists.wikimedia.org