[00:33:27] So with the hooks being done via classes now, does that mean I need to separate each hook for an extension into its own file? [00:34:03] Still trying to figure out this new system so we don't have to scramble to use it when the old way is inevitably deprecated [00:41:01] jfolv: I think you can do it like that, but you don't have to [00:41:29] Unless I'm completely mistaken... you can have a hooks class that implements numerous interfaces [00:42:07] Ooh, I didn't realize you could do that. Thought it was strictly one per class. That makes more sense, then. [00:42:20] There may be some caveats on it though [00:43:08] https://github.com/wikimedia/mediawiki-extensions-AbuseFilter/blob/master/includes/Hooks/Handlers/ChangeTagsHandler.php [00:43:25] https://github.com/wikimedia/mediawiki-extensions-AbuseFilter/blob/master/includes/Hooks/Handlers/TestsHandler.php [00:43:31] https://github.com/wikimedia/mediawiki-extensions-AbuseFilter/blob/master/includes/Hooks/Handlers/ToolLinksHandler.php [00:44:10] So maybe using a class for similar/related hooks [00:45:23] https://github.com/wikimedia/mediawiki-extensions-AbuseFilter/blob/master/extension.json#L293-L308 [00:45:32] Based on when/where service injection is needed [00:45:50] Having one class with 100 services being injected probably isn't a good idea for maintenance etc [00:51:05] Makes sense. Another question regarding setting them in the extension.json, I notice that not all hooks in that particular extension are set to a public static function. Some appear to just point to a class, specifically the ToolLinks hooks. Why is that? [00:51:46] That's the "new" way, I believe [00:52:09] And it take some time and effort to migrate, so only some have been done so far [00:52:20] Ah, okay, so half are done the old one and half the new way [00:52:26] Right [00:56:17] I wonder what the deprecation timeline is for this [00:56:33] I imagine it's going to be around for a few years... But yeah, if you're working on stuff, getting ahead of the curve shouldn't hurt too much [00:56:45] I do too. I would imagine the first thing to go would be $wgHooks, followed by the Hooks in extension.json [00:56:59] Then it'll all be under HookHandlers [00:57:54] Migrating probably shouldn't be that much work.. "hardest" thing is needing to rename functions [01:00:27] The stuff I'm working on is pretty old, using $wgHooks and a bunch of deprecated things like Revision::newFromTitle() or $wgUser->isAllowed() [01:00:49] I'm still not very familiar with the services yet, though I'm starting to get a grasp on them [01:01:56] I'm not particularly familiar with namespacing, either, but this is a good opportunity to learn more about it. [01:40:07] Okay, so I'm having a bit of trouble getting this to work. https://pastebin.com/NBcnKy52 this is the relevant part of the extension.json, and I have a class called CheckEmailHooksHandler located in extensions/CheckEmail/includes/CheckEmailHooks.php [01:40:57] Is my syntax incorrect? Or maybe I need to explicitly load the class? I tried using AutoloadClasses but that didn't do much either. I still get Class 'MediaWiki\Extension\CheckEmail\CheckEmailHooksHandler' not found [02:01:48] You need to add it to autoloadclasses if you're not using autoloadnamespaces [02:17:07] Okay, so that should look like this if I'm right: https://pastebin.com/aunh90Hu [02:17:38] But that still gives the same error. [02:25:18] Nope [02:25:33] If it's namespaced in the class, it needs to be namespaced in the AutoloadClasses entry [02:26:15] So if you're wanting to use AutoloadNamespaces [02:26:19] "AutoloadNamespaces": { [02:26:19] "MediaWiki\\Extension\\CheckEmail\\": "includes/" [02:26:20] }, [02:26:34] You need to rename the php file name to be the same as the class, so CheckEmailHooksHandler.php not CheckEmailHooks.php [02:27:50] Ah, alright [02:45:33] Alright, this is starting to make a bit more sense, but I still can't get it to load correctly. I ended up with this: https://pastebin.com/XzqTCu0D [02:46:27] I've been reading the example you sent me and trying some different combinations [02:46:43] It has to be a case of me just missing some small detail at this point [03:14:00] I figured it out. I wasn't namespacing the class so of course it didn't find anything. [03:25:55] heh [03:26:06] Yeah, that'd do it ;) [03:28:28] Like I said, pretty new to the namespacing thing. Never had to use it before [03:54:39] How about this one: I'm experimenting with the service injection so I can do away with using $instance in favor of just injecting them (this seems like the best way, anyway). I want to pass the userFactory and the permissionManager, so I did this: https://pastebin.com/MvfwySKu and then followed the example in the AbuseFilter and put them in the constructor like this: https://pastebin.com/hsqB6Lnd yet I get an error saying "NewFromId" is [03:54:39] not defined on $this->userFactory [03:55:49] At first I thought it was because I used "private," but I did a few var_dumps in the constructor and found that it's just not getting passed anything [03:57:37] And I just saw it while I was posting that. __constructor instead of __construct >.> [04:45:36] When exactly is the onIsValidEmailAddr hook called? I figured it would run when someone signs up or tries to change their email, but it won't run my code at all [04:46:02] Do I have to configure SMTP to get it to run? [04:46:06] (Doing local testing) [05:03:01] okay nvm figured that out too [05:15:11] Btw Reedy thanks for your patience, as usual. The system actually makes sense to me now. [06:45:50] Would anyone be able to help me debug a piece of a template, please? It's intended to set the font size based on the length of a certain parameter, but instead throws `Expression error: Unrecognized punctuation character "{".`. [15:20:35] anyone know's how to fix a server This page isn’t workingmx.kazdel.com is currently unable to handle this request. [15:21:02] i am no sure how to fix it i did not add any bad extensions? [15:21:26] !debug [15:21:26] For information on debugging (including viewing errors), see https://mediawiki.org/wiki/Manual:How_to_debug . A list of related configuration variables is at https://mediawiki.org/wiki/Manual:Configuration_settings#Debug.2Flogging Also see https://mediawiki.org/wiki/Manual:Errors_and_symptoms [15:21:44] Undo what you did previously of getting this error [15:25:42] i did not seem to do anything to it [15:36:12] @Reedy do debuging Fix it most of the time? [16:00:34] Cocopuff2018: There isn't a magical button or key combination that, when you turn it up, it fixes things automatically. Instead, you should first determine the cause of the problem, and once you know the cause, find a solution for it. Getting a descriptive error message from logs is a good start [21:50:46] does anyone know how to configure images http://mx.kazdel.com/index.php/Special:Upload [21:52:43] !upload [21:52:43] File uploads are disabled by default, set $wgEnableUploads=true; to enable it. See for configuration details, and for using uploaded images and other files. [21:54:10] i kinda wish they were enabled by default