Game On!

A forum for discussion of the front-page blog posts on the Wongery.
Post Reply
Clé
Posts: 111
Joined: Thu Dec 20, 2012 12:41 pm

Game On!

Post by Clé »

D minus three days and counting...

Well, I hoped I'd be able to say today that I was done with all the programming I was going to do before the hard launch, and from here on out all I have to do is write articles... oh, yeah, and update the site's layout. Unfortunately, I can't quite say that. Well, I could say that, but I'd be lying.

Another thing I'd hoped to be able to say today, though, is that I finally have the subspaces implemented, with the tabs working the way they're supposed to. And that I can say! It's done! The tabs appear just the way I said they would in my last post! Hurrah!

As usual, I did run into some hitches. It turned out that my Subspace extension wasn't fully working after all; I'd checked to make sure it was sending the correct page data, I thought, but it turned out that data wasn't being received, or something; anyway, somewhere between where I'd output the page data to check that it had the right namespace and title and its actually displaying the page, the title was reparsed back to how it started. That is, for instance, "Game:RPG:EABA:Varra" was back to being parsed the default way as an article with the title "RPG:EABA:Varra" in the namespace "Game", instead of an article with the title "Varra" in the namespace "Game:RPG:EABA". It took me a while to pin down this problem, but it turns out that either I had to do what I was doing with a different hook (WikiPageFactory), or I had to have the hook handlers return false, or possibly both. I'm not sure, because after I did both those things it worked, and I didn't really test in between, so I'm not sure which of them did the job, or whether both were necessary. Whatever. It works now. Oh, and as usual it's on Github at https://github.com/ClaySalvage/SubspaceTabs if you want to check it out, which as usual you shouldn't, because as usual it's a mess.

That's not to say it's all working exactly the way I envisioned, of course. There are a few things I'd like to have it do differently that I haven't implemented yet and that are going to have to wait till after the hard launch. You can get to the subspaces by typing them into the search box or the address bar with the colons as delimiters, but in the URL and in the page title they show up with spaces or underscores instead, which isn't ideal. The page name shown at the top of the current tab can be ugly—I think I know how to fix that, actually, and I think it would be a relatively quick fix, but with only a few days remaining until the hard launch every day is precious. So I'll leave that till after the

And that being done, I went ahead and started adding articles to the Gamespace. I have a lot of Gamespace articles already written or partially written, so a lot of it was a matter of cutting and pasting. There are no actual game statistics up in the Gamespace yet, but there are some things up in the Gamespace, and more pointedly at least there is a Gamespace, so... it's a start. There's also a Buildspace, and an Assetspace, and a Sourcespace, and a Worksspace, though there are no pages in any of those yet.

That wasn't all that took up my time since my last post, though. As I was writing the Gamespace articles, I ran into a few issues that sent me down various rabbitholes. First of all, I mentioned in the Gamespace Main Page a hypothetical article in the Public Wongery, and decided I should probably see about protecting that article name there so people don't mess around creating that article as a joke (which I guess wouldn't really harm anything, but I feel like it would bother me for some reason). And that reminded me that I still hadn't installed my new extensions on the Public Wongery. So I did, but then when I tried going to the main page of the Public Wongery I got an error:

Fatal error: Uncaught ExtensionDependencyError: WongeryNamespaces is not compatible with the current MediaWiki core (version 1.37.1), it requires: >= 1.38.0. Subspace is not compatible with the current MediaWiki core (version 1.37.1), it requires: >= 1.38.0. SubspaceTabs is not compatible with the current MediaWiki core (version 1.37.1), it requires: >= 1.38.0.

Whoops! The Public Wongery is using an older version of MediaWiki than my own extensions could handle! Well, that might not actually be the case; I might have set the requirements in my configuration files higher than they really needed to be, and maybe they'd work anyway; but I figured if the Public Wongery was still using an old version of MediaWiki it was due for an upgrade regardless. So I went ahead and upgraded the Public Wongery MediaWiki installation, which itself turned out to be a much larger chore than I'd anticipated. For some reason when it got to the step about updating the databases, it kept running into errors trying to remove indices that weren't there. I eventually got around this by using the phpMyAdmin interface to put in the missing indices so the installer could remove them, but it took a lot longer than it should have. And even then, I was getting an annoying message at the top of the page:

Deprecated: Use of InterwikiLoadPrefix hook (used in MediaWikiExtensionInterwikiHooks::onInterwikiLoadPrefix) was deprecated in MediaWiki 1.36. [Called from MediaWikiHookContainerHookContainer::register in /home1/dsg2m5v0/wongery.com/p/includes/HookContainer/HookContainer.php at line 438] in /home1/dsg2m5v0/wongery.com/p/includes/debug/MWDebug.php on line 386

Blargh. Okay, it looked like I'd have to update the Interwiki extension too. So I did... and the message was still there. I took a look at the Interwiki extension code to see what was causing it, and found this helpful comment above the guilty line:

// This will trigger a deprecation warning in MW 1.36+

It sure will. It suuuure will.

But there didn't seem to be any way to resolve the use of the deprecated hook except to add a line to the LocalSettings.php file to suppress deprecation warnings, so eventually that's what I did. I felt there must have been a better way to do that, since after all I wasn't getting those warnings on the Central Wongery—but then I noticed that for whatever reason I had added directives in the Public Wongery LocalSettings.php to display errors and exception details, directives that weren't there in the Central Wongery. So... eh, whatever.

Also, in writing the Game:RPG page, I had occasion to refer to what I had been calling the Static License, and I decided that even though that license didn't actually exist yet (because I haven't had the money to pay lawyers to draft it) I probably ought to write an article about it in the Metawongery that I could link to, and if I was going to do that, I probably ought to make an effort to finally come up with a better name for it, because seriously, "the Static License" is not a name I am enamored with. After considerable consideration and consultation with various thesauri, I finally settled on the "Akinetic Media License", which maybe sounds a little silly (or maybe more than a little), but I think I'm going to stick with it because there are more important things I need to spend my time and energy on.

Then there was one last thing that ended up taking way too much of my time. There was no simple way to link to the main page of a subspace; if I tried linking to "Game:CCG", it wouldn't go to the main page of the Game:CCG namespace, but would try to create a new page called "CCG" in the Game namespace. At first I considered this a detail that could wait until after the hard launch to be implemented, but I got tired enough of having to continually type out links like "[[Game:CCG:Main Page|Game:CCG]]" that I eventually decided no, this was something that I may as well take care of now. While I was at it, what about the top-level namespaces? "[[Game]]" wouldn't link to the gamespace; it would link to a mainspace article with the title "Game", and while I thought I could change this, I didn't think I wanted to, because I may eventually actually want to have a mainspace article named "Game". The solution I came up with was to make it so that if you typed a namespace followed by a colon, it would take you to the main page; this you could get to the Gamespace by just using the URL wiki/Game: or the link [[Game:]].

This required a revisit of the Subspace extension I thought I was through with. Getting the former part implemented, getting for instance [[Game:RPG]] to actually go to the RPG namespace instead of an article called RPG in the base Gamespace, turned out not to require any new hook handlers, only adding a few lines of code to the ones I was already using. But the latter part, getting for instance [[Game:]] to go to the Gamespace Main Page instead of, well, nowhere, turned out to be a struggle. I did manage to get it working with the searchbox; if you search for "Game:" you will indeed be taken to the Gamespace main page. But enabling you to get there by typing "wiki/Game:" as the URL, or using a link like [[Game:]], was another matter entirely. I tried hook after hook to get this resolved, but every hook I tried either didn't get called or didn't present any apparent way for me to change the wiki's behavior. Finally, going through the list of hooks in the MediaWiki manual, I got the last one that seemed to have any possibility of relevance, a hook called WebRequestPathInfoRouter. I had a bit of trouble figuring out exactly how this hook worked, but it seemed it was doing something with regular expressions similar to the .htaccess file...

Wait a minute, that gave me an idea! I didn't have to implement this in the extension at all! All I had to do was add a few lines to the .htaccess file to add "Main Page" after wiki URLs that ended in colons! It maybe wasn't the most elegant way of doing things; it had its drawbacks; but it should work.

Only it didn't, and I'm completely at a loss as to why not. I checked my RewriteRules in an online .htaccess tester, and they seem to be doing what they're supposed to, but they don't seem to have any effect on the wiki. Is the wiki overriding the .htaccess file somehow? But when I comment out the lines in the .htaccess file that "prettifies" the wiki URLs, that stops working, so the .htaccess file is being read. Why aren't my rules being applied? I have no idea. I'm extremely confused. I don't know what's going on.

But at this point, I really have to make myself leave that till after the hard launch. I have too much else to do to spend this much time on what is after all a very minor detail of the subspace implementation. Sure, I'd like to have an easier way to link to the main page of top level URLs, but there are a lot of other things I want to do before the hard launch that should be a higher priority. I think part of the reason I was so focused on getting this done was, well, I said in the previous post that I didn't want to get cocky, and I think maybe I did. After managing to get the most important parts of this extension done and to finally implement the subspace tabs, something that I had long been wanting done but harbored considerable doubt I'd ever be able to do, maybe I got a little overconfident and kept thinking that with a little more time, surely I could resolve this last issue, surely I could find a way to get this working like I wanted, surely this one little detail wouldn't stand in my way. And maybe there was a part of me that just wanted to prove to myself I could do it. I don't know. But I'm going to set this aside. I'm not going to like it, but I'm going to set this aside.

(Oh... but once I got the part of it working that I did get working, I pushed the updated version of the Subspace extension to github, so it's there at https://github.com/ClaySalvage/Subspace if for some inexplicable reason you want to goggle at my shoddy programming.)

Even if I do resist the temptation to revisit this issue before the hard launch, there's one other programming detail that I do want to do, which, is to get the blog posts to be accessible through their more descriptive short names as well as through the date-based keys they currently have, and to have those short names be their default URLs. But that's something that should be very simple; it's a minor variation on what I've already done; and I don't expect that to present any unexpected difficulties. So, if all goes well, or at least not horribly wrong, this will be my last pre-hard-launch blog entry in which I'll have anything to say about programming. If I do get that blog fix implemented (which I fully expect to do), I'll say that I did it, but I don't expect to have any details to go into about the process.

But anyway. Let's focus on the most important good news over the past day. Which is that the subspaces finally exist, tabs and all! I can finally make all those pages in the Gamespace and the other subspaces I've been wanting to make! This is something that for so long I've been wanting so badly to have, and I'd been so dubious of my abilities to actually do it, that I'm still finding it hard to believe it's finally done. Now, though, of course, I still have a lot more to do...

D minus three days and counting...

Post Reply