Manual talk:Skin autodiscovery

Jump to: navigation, search

About this board

By clicking "Add topic", you agree to our Terms of Use and agree to irrevocably release your text under the CC BY-SA 3.0 License and GFDL
Kghbln (talkcontribs)

Due to fixing bugzilla:70672 and the fact that bugzilla:71621 is stuck in some kind of meta talk and will most probably end up as WONTFIX users now have to create custom skins from MonoBook and/or Vector to have e.g. a decent login and preferences page.

However if you do this for MW 1.23 (LTS) you end up with the autodiscovery warning kinda spamming your server log. The new versions of MonoBook and Vector currently only seem to be available for MW 1.24+. Thus it will be nice to have these backported for MW 1.23 to avoid these continuous warnings and probably to have as skin that will not go berserk directly at the next upgrade. This will be cool to have.

If the current extensions created for MW 1.24 are also usable with MW 1.23 when tagging them accordingly will be great.

Hmm... probably a bug should be filed for this?

Kghbln (talkcontribs)

Yeah the MonoBook and Vector skin extensions definitively do not work with MW 1.23. So I take all your answers as a no for any backport effort.

88.130.118.177 (talkcontribs)

The handling of custom compared to build-in skins in MediaWiki 1.23 is flawed for the reason you mentioned: MediaWiki complains that using autodiscovery would be deprecated while at the same time using autodiscovery itself. You will find me having said that this situation should be improved, however, according changes to fix this flaw have never been implemented.

In the meantime half a year has passed and MW 1.23 no longer is the latest release. MW 1.24 in contrast does come with fixed core skins, which do no longer cause autodiscovery warnings. What I personally did was to update my skin for 1.24 and update my installations.

For 1.23 the situation is, as I noted back then, as you now noted as well, bad, but I don't believe now, that MW 1.23 already is old, anyone will come up and fix this.

Matma Rex (talkcontribs)

I doubt the release team will support backporting the refactoring of skin system from 1.23 to 1.24.; but if you strongly feel that the deprecation messages themselves are more harm than good, then you might want to file task about it on Phabricator (be sure to add the #Wiki-Release-Team project) – MW 1.23 is a long-term support release, so it might be worth it. Personally I still think the messages are useful, but I won't argue about it. :)

Kghbln (talkcontribs)

The "problem" with 1.23 is that it is an LTS release supported until 2017 and it will probably be a horror for regular MediaWiki users to migrate e.g. MonoBook derived custom skins not to use autodetection for this release. I guess it would have be done for MonoBook right away if it was easy.

Matma Rex (talkcontribs)

I think the guide here is pretty good, and there were at least some people who successfully followed it and migrated their skins (some even improving the guide in the process <3).

The built-in skins' migration was delayed because:

  • When 1.23 was being released, it wasn't yet clear what repository and directory structure we want, and it took a while to push these discussions through without angering too many people.
  • They were too deeply integrated with MediaWiki; primarily Vector, which MediaWiki couldn't run without at the time, and I didn't want to only migrate some skins because then the thing would definitely get stuck half-done forever. Custom skins usually don't implement things like autoloader entries, localisation messages, hooks… The actual MonoBook cleanup commit, when all the dependencies were resolved, wasn't difficult: ec1ccf4367515dfeba5d5f8edb2dfca00b7505ac (Vector took several more messy commits, though).
  • I was the only person doing this and I just wasn't able to pull three of four all-nighters right then to get it done in time ;)
Reply to "Backport of MonoBook and Vector to 1.23"
70.106.148.11 (talkcontribs)

I got annoyed with the error message, and it didn't go away after following the instructions in this article, so i went into /includes/debug/Debug.php, deleted the if function on line 303, and left my skin as-is. I plan to never upgrade, but security isn't an issue because I .htaccess protected the /wiki directory and chmod 600'd my .htaccess and LocalSettings.php.

88.130.104.217 (talkcontribs)

Modifying Core files is bad and should not be done.

The message in fact is generated in includes/Skin.php, function getSkinNames(). Basically there simply is a check for file names of PHP files, which are directly located inside the skins/ folder. Each of these files produces one such warning. Interestingly at least in 1.23, the Core itself still does use autodiscovery while it complains when you do in your skins. That is why there is this funny construct, which filters out Core skins before complaining. Because the Core is still using autodiscovery itself...

However, the solution is to update your skin accordingly. Afterwards the file directly in the folder skins/ is no longer needed and can be removed. With this removal, the warning will disappear.

95.109.55.58 (talkcontribs)

I've been trying to migrate my skin for a few hours without success.

Deleting this in Skin.php removed the error message:

if ( !in_array( $aSkin, array( 'CologneBlue', 'Modern', 'MonoBook', 'Vector' ) ) ) {
							wfLogWarning(
								"A skin using autodiscovery mechanism, $aSkin, was found in your skins/ directory. " .
								"The mechanism will be removed in MediaWiki 1.25 and the skin will no longer be recognized. " .
								"See https://www.mediawiki.org/wiki/Manual:Skin_autodiscovery for information how to fix this."
							);
						}

Thank you.

213.185.227.76 (talkcontribs)

Does this work and will it remove the errors so the wiki is usable again ? I'm lost in a state where nothing works right now but I was a bit uncertain about what code lines to change or remove not to make things even worse. Still if this is a working way forward I would try it as nothing else works right now anyway.

Kghbln (talkcontribs)

This error message is what I call spam. This does not give you time to migrate until 1.27 is out, it forces you to migrate immediately to avoid error logs reaching several megs a day.

88.130.118.177 (talkcontribs)

Several megabytes a day is what I call small. I had that after 5-10 minutes. Log rotation helps keep the file size usable and updating the custom skins helps prevent these notices from being created.

Kghbln (talkcontribs)

Admittedly I was pretty grumpy when writing my last post. No offence please. I ended up with 400 megs within a day after upgrading and I consider this one to be just a medium size wiki. I would like to have this message showing up on Special:Version or so rather than having this in the error log on every hit the wiki recieves.

Reply to "Error Message"

No clue how to handle new skins functionality

4
213.185.227.76 (talkcontribs)

So I upgraded from 1.22.x to 1.23.5, which completely broke my entire wiki. The new skins functionality first warned about errors in skins, just as described in the upgrade log. I then attempted to correct this by adding the require_once text described in the manual skin talk page to the LocalSettings.php, which produced an endless long list of new errors I have no clue about. So I then tried to delete unnecessary skins except the one I use, no change there.

Then I tried excluding the part I didn't understand about pointing to the non-existing MySkin.php file, and instead in LocalSettings pointed to my own skins theme file. This didn't work, since I then got a ton of errors from the skin file and I have no idea how to modify this file to work.

So lastly I tried changing LocalSettings to point to Standard.php skin file, this still didn't work, so now the whole site is down, and I'll be trying to do a restore instead. That is of course a nice excercise but this while thing just once more reminds me that what I really should be doing instead of upgrading is migrating to WordPress.

I even tried to redownload the full 1.23.5 to extract just the MySkin.php file to use that, but it wasn't there so now I have completely lost myself in a maze of errors.

If only now I can get back to the previous version I believe I'll leave it there until I can migrate content. Security issues or not, upgrading seems to effectively kill the site which to me is worse than what any breach can achieve. Unfortunately I see no other way out of this right now.

213.185.227.76 (talkcontribs)

Addition, while I've no idea how to get skins to work at least I've managed to reset the wiki to use the Standard skin, which while quite plain and lacking in style and desig at least allows me to access and start to migrate content rather than downgrade.

Matma Rex (talkcontribs)

MySkin on this page is meant as a placeholder for the name of your skin, if you're using a custom one. If you're not using a custom one, you don't need to do anything. You can silence the error messages as somebody described in the thread above: Thread:Manual_talk:Skin_autodiscovery/Error_Message/reply_(3), but you'll still need to handle this before further upgrades.

88.130.118.177 (talkcontribs)

A few days ago I have reworked the page and what it says now is exactly what I have done in order to update my skins for MediaWiki 1.24. What it told before contained a few errors and improprieties, but these are fixed now.

Note that the page tells you that you can split your skin file (in the examples always MySkin.php) into several files (which makes sense doing, because a skin file up to now always contained the main skin stuff, a skin class and a template class. Things are arranged more clearly if these are seperated!

Reply to "No clue how to handle new skins functionality"

Whoops! The default skin for your wiki ($wgDefaultSkin), vector, is not available right after installation

1
Saper (talkcontribs)

Since "core skins" are no longer in the core; I think I've just run into bug 70222.  « Saper // talk »  00:03, 31 August 2014 (UTC)

Reply to "Whoops! The default skin for your wiki ($wgDefaultSkin), vector, is not available right after installation"
Iowajason (talkcontribs)

I found it simpler to just delete files in the skins directory. I was warned on about 5 "old" skins after upgrading. I just went through the list of warnings and deleted the files. That seemed to be sufficient to keep my wiki running. I deleted both the main file in /skins directory as well as all support files and I ceased to get error messages.

CayceP (talkcontribs)

I don't think this is a very good idea, especially for inexperienced users since 1.23 still looks for the skins in /skins if nothing else is specified in LocalSettings.php. and of one of the affected skins is used, especially as default skin. On my local installation deletion (or renaming) of the skins folder and or the Vector.php etc files caused a fatal error and Skin not found warnings.

Not sure why it worked for you, though. I guess you are using a custom skin or one that is already compatible?

The bundled skins will work and it's not that hard to migrate customs skins.

Iowajason (talkcontribs)

Thanks for the input. I'd guess I don't have any users who specify their skin so the skins I deleted were never requested. I have no custom skins. HTH.

88.130.104.217 (talkcontribs)

Two things:

First: As far as old core skins are concerned, Upgrade already tells us to remove these according files and folders as far as these skins have been removed from MediaWiki itself. These files belong to the category "old files left behind, which may cause trouble".

Second: As far as in contrast custom skins are concerned, these should be upgraded as described at Manual:Skin_autodiscovery. You surely can remove them as you described above, but doing so basically just uninstalls the skin. In your case that obviously was OK - for others it may be no option.

Reply to "Upgrading to 1.23"
Matma Rex (talkcontribs)

It has been suggested to provide an example of how the migration was done for core skins – unfortunately it looks like it's not really possible or practical to do this:

  • No one listened to me, and Modern and CologneBlue have been immediately moved to separate repositories while being converted (change in core is , new repositories are and ). This makes comparing differences hard to impossible.
  • MonoBook and Vector are, most of all, not done yet; when they will be done, the diff will be full of core changes where the skins were hard-coded or just intertwined with core code, which is obviously not relevant for normal skins.
  • The only non-core skin that has even been deployed on Wikimedia wikis so far, Nostalgia (which is only used by nostalgia.wikipedia.org), has always used the new way since it was recovered from the great skin purge over a year ago.

If you think this can be put in an useful form, do suggest a way or just improve the page, but I don't think it can be made useful.

88.130.77.186 (talkcontribs)

Hi there!

I was the one who added the idea to show people how the Core skins got separated from the Core. The reason I find this info useful is simply that there are a number of skins, which are basically Vector clones. They look different and so, but technically they are forks of Vector. I am even maintaining some of them in a Git repo where I have the upstream Vector updates merged into the custom skins. While I think that many custom skins are based on Vector, I doubt that all maintainers use Git to get the updates easily. They are who this information is useful for.

---

Text of my draft.

Matma Rex (talkcontribs)

(A link to an example commit has been added some time ago. I'm still not convinced it's helpful, but alright.)

88.130.109.101 (talkcontribs)

It's the most helpful thing on the whole page.

Reply to "Making an example of core skins?"
There are no older topics