[01:53:18] Merry Christmas. MW newbie here - Just upgraded a client from 1.21.2 to 1.24.1, and their $wgUser->isAnon call in a skin (which had been working fine) now yields non-object error. Any changes to how the call should be made for 1.24.1? [01:55:14] Abulafia, what extension? [01:55:19] can you show me the error? [01:55:26] wgUser should still be getting set, I think... [01:55:51] It's in a skin, outside the class (right at the beginnign) [01:57:48] Krenair, thanks. Error: PHP Fatal error: Call to a member function isAnon() on a non-object in /home/wiki/mediawiki-git/core/skins/skinname/skinname.php on line 4. Relevant code at top of skin is here: https://dpaste.de/b0VY [01:59:03] Previous version didn't require the require_once for the skin, so added that to LocalSettings.php, right before the require_onces for the extensions (though have tried a few other spots as well in my ignorance) [02:01:38] Hmm... No I don't think you can use that there... [02:01:53] can you paste your full code? [02:02:08] Odd, it seemed to be working before I did the upgrade. Sure thing, one sec. LocalSettings or skin? [02:02:25] skin [02:03:34] The part that throws the error is right at the top: https://dpaste.de/VuOC [02:03:50] (The version there is unchanged from me and was working in 1.21.2) [02:04:23] Not sure if it's relevant, but I haven't yet updated all the extensions. I figured wgUser wouldn't require them, but I'm pretty ignorant. [02:10:54] Krenair - Thanks BTW - didn't know if there'd by many folks on this eve! [02:13:25] Abulafia, hmm... You're including that in the skin file that you load directly from LocalSettings? [02:13:43] Yes - top of the file. [02:13:52] wgUser doesn't require extensions, correct [02:13:53] It's the skinname.php file within the skin dir that I should be including right? [02:14:09] It doesn't matter what you call the file [02:14:37] But I don't think you should be checking user's login info or outputting styles while LocalSettings loads [02:15:08] I guess they were using the autodetect before, and that might load the skin info at a later point, after wgUser had initiated? [02:15:41] I'd been using the migration guide at http://www.mediawiki.org/wiki/Manual:Skin_autodiscovery#What_should_I_use_instead.3F to set up the require_once [02:16:11] I think it's step 4 there that I maybe didn't clue in on. This would count as an "additional MediaWiki feature"! [02:16:52] A case of RTFM I think - Do you know where I'd best find out how I'd go about including the appropriate resources for $wgUser? [02:17:47] hmm [02:18:36] Did you take a look at how Vector works, Abulafia? [02:18:52] Not at all. [02:21:55] Just looking a little now. This is a Vector based skin. [02:22:41] Ah! That's probably it. Hadn't installed vector extension yet. Doing so now [02:24:37] No luck. I also see now that it says that the Vector extension's been replaced with features in 1.22 anyways. [02:33:29] Abulafia, so this code worked before, not after the update? [02:33:43] Right. [02:33:48] Abulafia, and I meant the Vector skin, not extension [02:34:15] Ok. Yes, the skin worked before. [02:37:38] To learn PHP and start hacking Mediawiki or not..That is the question [02:38:28] I'm guessing the difference is going via require_once in LocalSettings rather than however the skin autodiscovery process used to work. [02:53:13] Krenair, would there be an alternative way to put in the necessary CSS via wgUser - outside of the skin? [02:53:48] I don't think you're supposed to do it while LocalSettings is being loaded still [02:53:56] but I am not a skins person [02:54:37] Did you look at how the Vector skin does it? [02:54:40] Fair enough, i'm just wondering if there would be some other way, outside of LocalSettings. I know little enough about MediaWiki to not know whether that would require an extension, or what the proper method of adding CSS based on what isAnon() returns. [02:54:53] Or if that's just something you used to be able to do that you can't anymore. (It seems like a useful ability) [02:58:42] Krenair - I'll take a peek at Vector. I'm not even sure if Vector does do it, I'm having trouble finding any examples of isAnon() being used in a skin. [02:58:58] oh, you don't need to look for isAnon specifically [03:05:19] Krenair - sorry to be thick, but what would I look for? Vector using some sort of core variables? [03:11:52] Abulafia, yeah [03:12:33] I think this could all be done with a ResourceLoader module to load JS that checks the user is logged in and applies the css [03:13:08] might be possible to use skipFunction to just load a CSS file [03:13:09] Ok, I'll try to seek that out - thanks! Do you know what a good keyword or two would be while googling? (I'm new to MediaWiki / Vector vocab) [03:13:29] Krenair - the ResourceLoader option sounds good, I'll look into that as well. Thanks! [03:23:30] as I said, check how Vector loads JS etc. then checking user logged in status and adding CSS should be easy [03:25:14] Perfect, thanks [07:20:15] http://si.wikipedia.org/wiki/%E0%B7%80%E0%B7%92%E0%B7%81%E0%B7%9A%E0%B7%82:%E0%B6%B1%E0%B7%80_%E0%B6%B4%E0%B7%92%E0%B6%A7%E0%B7%94%E0%B7%80?namespace=all&tagfilter=&username= This page which shows the new pages added for sinhala wikipedia only show pages added within last month, Can I change that time constraint? [07:45:13] Ok so I have a question. [07:46:01] I have a wiki on a website that also has several other pages and uses; however, if, for example, I accidentally link to a file that doesn't exist in a different directory, it automatically goes to the wiki [07:47:04] So how do I make it not do that, and instead go to a different page--an error page would be nice [13:02:38] http://si.wikipedia.org/wiki/%E0%B7%80%E0%B7%92%E0%B7%81%E0%B7%9A%E0%B7%82:%E0%B6%B1%E0%B7%80_%E0%B6%B4%E0%B7%92%E0%B6%A7%E0%B7%94%E0%B7%80?namespace=all&tagfilter=&username= [13:03:33] how can I get new posts for last 2 months or any customized time from this link?It only gives pages created in last month [15:35:10] chamila: new page status is only tracked in the recent changes table which records for 30 days [17:04:39] Betacommand: Is there any way I can get pages added after a certain date, probably of a day about 1 year ago? [17:17:11] chamila: not really [17:17:43] Betacommand: thank you [19:10:20] Hi all. I had a problem with a server and lost the mediawiki installation but not the mysql. How can I determine the wiki version from the database¿ [19:12:15] you can't easily; however you can always install the most recent version of mediawiki and then run the upgrade.php maintenance script -- that will upgrade your database to the most recent version [19:13:00] (by "install the most recent version" I actually mean "download the most recent version, then during the installation use your existing database so that it upgrades it instead of making a fresh install -- back up your database first!) [19:13:16] I was unable to do that, but I have been looking the dump now, and I think I installed it with prefixes... [19:13:27] some of my first installations.... I will try again :-) [19:16:48] yes, it worked! [19:17:56] I had to set $wgDBprefix and now works! The problem was that error messages were not sufficient for me to determine the cause of the error. Thanks for the support [19:19:53] asabigue: hmm, you could probably look at which database tables are present. this probably won't let you pinpoint the version, but you will get some idea [19:19:57] !schema [19:19:57] http://www.mediawiki.org/wiki/Manual:Database_layout [19:20:02] !database [19:20:02] http://www.mediawiki.org/wiki/Manual:Database_layout [19:20:22] (hmm, wm-bot is dead?) [19:21:12] wm-bot is more alive than you! [19:21:39] do you have it in /ignore? :P [19:21:58] asabigue: we don't keep a precise version history for table columns, there's only https://www.mediawiki.org/wiki/Manual:Database_layout#Version_history [19:22:29] ugh, no [19:22:47] i was apparently lagged by almost a minute. weird. [21:34:08] Hi Folks, I'm trying to have my skin run a conditional based on wgUser->isAnon(). It was working in 1.21.2, but isn't in 1.24.1. It was suggested I look into Resource Loaders, and I'm looking here: http://www.macfreek.nl/memory/Creating_a_MediaWiki_Skin but wanted to make sure this approach was still current, as that page advises it's not been updated in quite some time. [21:36:51] I should note that I'm a MediaWiki newbie. We're trying to have our skin use CSS to hide some elements if wgUser->isAnon(). There may be a better approach (I'm open to anything in line with best practices)\ [21:38:14] Abulafia: https://www.mediawiki.org/wiki/Manual:Skinning seems less outdated than the page you linked. [21:38:40] Abulafia: can you share the code you have? [21:40:52] Thanks MetmaRex - yes the way we had been doing it (1.21.2) was just this at the top of the skin's PHP file: https://dpaste.de/V7eL [21:41:19] I'm guessing the old skin autodetect happened at a stage late enough to allow access to wgUser in a way that it doesn't when you require_once from LocalSettings.php [21:57:30] I may have solved my issue, though not the way I thought I should - adding it into the skin's execute() as opposed to just at the top of the skin file but not in the class. I appreciate the help!