[00:31:24] Hello. I've just recently created a wiki using Mediawiki and have installed my first extensions, but none of them seem to actually be working despite showing up on Special:Version. I have tried clearing my cache as well as using other browsers, but that was ineffective in solving the problem. The only other thing I've done on this site thus far was enabling a short URL, which appears to have worked. Could I have some help? I'm happy [00:33:08] Chirp: what extensions in particular? and what do you expect them to do? [00:33:34] MsUpload and WikiEditor. [00:33:56] They should be readily visible when editing pages, if I understand correctly, but I'm still seeing the default input field. [00:39:09] Chirp: i don't know about MsUpload, but i think in the default configuration, users have to enable WikiEditor in their preferences [00:39:24] Chirp: you can set `$wgDefaultUserOptions['usebetatoolbar'] = 1;` in your LocalSettings.php to make it default [00:43:02] Ah, that did fix WikiEditor, by the looks of it. Thank you kindly. [00:45:04] :) [10:15:45] Where can I find a "cheatsheet" that explains all the things used when editing pages? Like what is the difference between {} {{}} {{{}}}? [10:16:04] What are these things called, templating language didn't get me anything useful [10:25:22] is it wiki markup? :) [10:30:12] harmaahylje: https://www.mediawiki.org/wiki/Help:Editing should help [10:32:41] Reception123: Thanks, for some reason I did not come across that specific page [10:32:56] No problem [10:33:10] I am again having this caching(?) problem. I updated the a sidebar of the site, but the changes don't load [10:33:31] Gotta figure this out, because I can't do much when I can't see changes I make [10:35:09] I restarted web server, no effect [10:37:04] Btw, why do the "variable" names change, when you switch the language of the site? Some images stopped working now that I change to English. In the edit mode I have Tiedostot (Finnish), but when I change mediawiki language, it should be File. Isn't that pretty dumb? [10:37:42] So if you decide to change the language of your wiki, all the File links will break [10:39:58] Hmm, I see, the changes might not be "valid" so they aren't shown. Interesting, so how do I know if the changes are valid or not then [10:47:37] Okay, action=purge might get rid of cachin issues, but really is there no better solution for development? [11:39:09] harmaahylje: try running rebuildLocalisationCache.php from /maintenance [12:05:36] Reception123: thanks for the tip, again [12:05:47] harmaahylje: Did it work? [12:30:39] Reception123: I am not working anymore so I didn't test it. I am not sure if the cache was the problem, as it seemed that the sidebar only accepted specific things [12:32:48] Hm. Maybe it wasn't then [12:36:29] greetings ;) would anyone be so kind as to tell me how I can access the mediawiki markup via the rest api? action=raw doesn't seem to work :-/ [12:45:18] ah, /index.php?action=raw&title=... [12:45:19] thanks ;) [15:16:38] Okay so I've set up a mediawiki install and now someone won't make an account until I tell them "how [am I] handling passwords" because appearently they take password security *seriously* (I assume they think nobody on the mediawiki team does) and "will nnot aid you in creating a database that's incredibly useful for reuse attacks." [sic] [15:18:30] What should I say to them to get them to stop talking and just make an account already [15:20:05] I found this: https://www.mediawiki.org/wiki/Manual_talk:User_table#.22B.22_type_password_.28current_default.29 and sent it to them, hope it's enough [15:24:34] Personally, I'd go the opposite direction. If they're concerned about password-reuse attacks (and they should be), they should create a password for this site, that they don't use elsewhere. Then there's nothing to re-use. (password managers/keychains make this a doddle) [15:25:39] this is the type of person whose arguments are along the lines of "Well, *I* don't reuse passwords but *someone* might" [15:36:45] the page you linked, I'm not entirely sure that's up-to-date. I seem to be creating passwords with scheme 'pbkdf2:sha512', and I've done nothing to customize that ( detail on schemes at https://www.mediawiki.org/wiki/Manual:$wgPasswordConfig ) [15:37:41] which may be good news, as salted-md5 is unlikely to impress your 'friend' [17:47:24] tonythomas: you around? [17:47:51] bawolff: yes - and strangely was typing in a message on the other channel for you :D [17:48:04] hope it has something to do with https://gerrit.wikimedia.org/r/#/c/346055/15/includes/content/NewsletterContent.php ? [17:48:34] Sorry I wasn't very responsive last week, had some irl things [17:48:50] just saw your comment there - but setting mainpage to "" makes the instance ofTitle test in https://gerrit.wikimedia.org/r/#/c/346055/15/includes/content/NewsletterContent.php to fail - making the isValid go false. [17:49:11] bawolff: ah. was wondering :) anyway - now that you are back I see a future for our deployments! [17:57:17] tonythomas: oh, I see [17:57:41] I wanted something like $this->mainPage = isset( $data->mainpage ) && !empty( $data->mainpage )? Title::newFromText( $data->mainpage ) : Title::newFromID( 0 ); or something there [17:58:16] just wanted the else thing to produce a Title object, so that is instanceof would return True [17:58:40] The problem is that you want all valid newsletters to be associated with a unique main page, but then you can't have a valid empty newsletter content object, as the user must chose a mainpage [17:59:30] bawolff: yes - there is no chance we can have an empty Title object - true [17:59:49] tried $this->mainPage = isset( $data->mainpage ) && !empty( $data->mainpage )? Title::newFromText( $data->mainpage ) : new Title(); and the page just 503 or something [18:01:06] I wouldn't use new Title() as a placeholder, that seems kind of icky [18:01:09] is there a dummy Title object which I can pass while creating in the makeContent [18:01:22] *makeEmptyContent() [18:01:39] bawolff: yeah - it just didnt work :-( [18:01:46] I guess you could do something like use some special page as the dummy title [18:01:57] ah. that makes sense - maybe Special:Newsletters [18:02:02] I'm writing an extension to add to mw.ext in Scribunto, and I've got it working except for one thing - I want to return a table, and my php function returns an array, but when it gets back to lua it is just a string. Can extensions return tables from php to lua? [18:02:20] Title::makeTitle( NS_SPECIAL, 'Badtitle' ); perhaps [18:04:16] bawolff: not 'Newsletters', right ? [18:04:22] alright. pushing in now. Lets see how it go [18:04:47] I don't think it matters much what the dummy title is [18:05:09] its gonna be in decode()! [18:05:14] pushing now. [18:07:26] bawolff: wow. it passed! [18:07:26] https://gerrit.wikimedia.org/r/#/c/346055/ [18:08:05] wiki_guest_2: I don't know much about scribunto implementation, but doesn't all the mw.title stuff return tables? I would think that means it should be possible. Try looking at whatever Scribunto/engines/LuaCommon and Scribunto/engines/LuaCommon/lualib does [18:08:09] Whee [18:08:26] want to give one final review ? I think the comment @var Title|null is not anymore valid for $mainPage as its gonna be just * @var Title [18:09:17] correcting in a jiffy. [18:09:29] Technically doing isset( $data->mainpage ) && !empty( $data->mainpage ) is superfluous, since !empty also checks isset, so isset( $data->mainpage ) && !empty( $data->mainpage ) is identical to !empty( $data->mainpage ) [18:10:01] agreed. pushing now [18:10:36] and i think you missed a space with the ? mark [18:11:14] bawolff: saw that too. things have became more complicated after I am into python :/ code styles [18:11:30] I'm surprised phpcs didn't ding you on that [18:11:54] oh, i guess phpcs isn't enabled on the newsletter extension [18:12:06] bawolff: I expect my phpstorm (with all mw plugins there) to help me out - but no :/ [18:12:52] alright. pushed! [18:15:23] bawolff: thanks for the tip. It seems one array is peeled off, so the trick is just "return array( $table );" [18:16:18] bawolff: one more review, and we might be able to close down Newsletter extension sec-review :D [18:16:20] Hmm, if we're being paranoid, the onEditFilterMergedContent hook should probably verify that its impossible to save a page with Special:BadTitle set as the newsletter main page [18:17:32] bawolff: well - the test was just running makeEmptyContent - and checking if its isValid() and nothing more [18:17:51] we are not **literaly creating** a newsletter, right ? [18:17:58] right [18:18:26] but we'd want to make sure that the user can't accidentally create a newsletter from makeEmptyContent somehow [18:18:29] well wait - during an API edit - when the mainpage is not set - will this lead to Special:Badtitle to be set as the mainpaoge ? [18:18:56] I think so [18:19:48] hmm. in that case - are you recommending a check in the hook to see if the mainpage is set to Title::makeTitle( NS_SPECIAL, 'Badtitle' ) ? [18:20:24] yeah, just in case. I doubt in practice it would really actually come up, but it doesn't hurt to be paranoid [18:22:19] could you use a title that is actually invalid, such as Bad|Title or Bad- [18:25:08] tonythomas: hmm, I'm getting some errors related to MWCallableUpdate::setTransactionTicket() being undefined [18:25:26] bawolff: I just put "if ( $content->getMainPage() == Title::makeTitle( NS_SPECIAL, 'Badtitle' ) ) {" in the hooks though [18:25:41] MWCallableUpdate sounds familiar. argh [18:25:55] tonythomas: you should use $content->getMainPage()->equals( Title::makeTitle( NS_SPECIAL, 'Badtitle' ) ) [18:26:25] wow. never knew. changed [18:26:34] I think it might be mediawiki's fault though and not this extension, not sure [18:27:34] bawolff: probably. I do not see it anywhere though [18:28:09] huh, that's odd. setTransactionTicket should be in the base class [18:29:25] is it happening on doing sth with a Newsletter - or - just showing up ? [18:29:30] cant reproduce :/ [18:31:23] Hmm, i think i might have misread the docs on getSecondaryDataUpdates [18:32:04] tonythomas: it generates the exception after the page is rendered when you edit a newsletter. it might only show up in log files [18:33:03] bawolff: oh - checking now [18:33:04] MWCallableUpdate is not a subclass of DataUpdate, which I thought it was :( [18:33:11] that's really confusing [18:37:05] I see it [18:37:05] Fatal error: Call to undefined method MWCallableUpdate::setTransactionTicket() in /var/www/core/core/includes/jobqueue/jobs/RefreshLinksJob.php on line 276 [18:39:37] bawolff: maybe we should pass in more arguments to the MWCallableUpdate constructor - public function __construct( callable $callback, $fname = 'unknown', IDatabase $dbw = null ) { [18:39:43] $fname or something ? [18:40:11] MWCallableUpdate doesn't extend DataUpdate, which is where setTransactionTicket() method comes from [18:40:28] I'm not sure if MWCallableUpdate is supposed to extend that or not [18:41:10] Probably what we should do is make a new subclass of DataUpdate, where doUpdate() method is basically the callback we are currently using [18:41:59] bawolff: you wont believe it. I passed wfGetCaller() as a second arg to MWCallableUpdate and - the error seems to be gone [18:42:14] saw it here - https://github.com/wikimedia/mediawiki/blob/ea747bb2d4a4f1fadbd57256df6a20037dfc3966/includes/deferred/DeferredUpdates.php#L119 [18:42:43] that really shouldn't fix it [18:43:17] bawolff: well. does not show the error message anymore though :P but yeah - probably its wrong [18:44:20] just thought that as https://github.com/wikimedia/mediawiki/blob/ea747bb2d4a4f1fadbd57256df6a20037dfc3966/includes/deferred/MWCallableUpdate.php#L19 sets the $fname by default to 'unknown' [18:45:32] the error is still triggering for me when I edit a newsletter page [18:56:21] tonythomas: I'm going to try and rewrite that as a DataUpdate subclass and upload the results [19:16:31] tonythomas: I uploaded a new version that should fix that issue [19:16:58] But now it appears that its running the table updates twice, so probably the db update code in NewsletterEditPage should be removed [19:25:50] bawolff: oops. sorry I missed the action - was out for dinner. [19:26:00] That's ok [19:26:03] bawolff: oh - okey. I can remove that [19:27:46] I'm not sure, but there's a possibility that Newsletter::fillParserOutput might run into issues involving slave lag when run on a real wiki [19:28:16] Since it assumes that the newsletter exists in the db at time of render, which possibly might not be true on first create due to delay on slave lag [19:28:37] I'll file a separate bug for that [19:28:42] right. [19:56:57] tonythomas: I submitted a coding convention fix patch to Newsletter. You may want to wait on merging it though, because it will probably cause conflicts with the current patch being worked on [19:57:06] https://gerrit.wikimedia.org/r/349281 [20:16:42] bawolff: yay, alright! [22:17:31] hi all; I'm looking for a way to identify pages that use a specific template. Is that possible? [22:19:32] Raazeer, try using Special:WhatLinksHere [22:20:17] OH- not a bad idea, thanks [22:20:27] be sure to include transclusions [22:20:45] e.g. to find articles with {{Infobox person}} on en.wikipedia: https://en.wikipedia.org/w/index.php?title=Special%3AWhatLinksHere&target=Template%3AInfobox+person&namespace=0 [22:23:40] OH-, thanks, that worked. [22:24:37] unfortunately, I now have a different problem: Apparently, templates don't accept any arguments with external links in them, e.g. {{R|Some Link: [www.some.link]}} doesn't work. [22:27:52] works for me (see https://test.wikipedia.org/w/index.php?title=User:Sn1per/sandbox&action=edit) [22:28:01] may be an issue with your template [22:28:24] how is it not accepting the argument? how does it look different than expected? [22:28:56] OH-, maybe it's something in the URL, it has parameters and everything [22:31:33] OH-, I think I know what's going on, if thene is an equals sign in it, it tries to expand it as a positional parameter, as in {{R|[www.test.de?link=test]}} would try to expand parameter '[www.test.de?link' with the value 'test]' [22:31:56] not positional, named of course. [22:32:48] yes, that's it, as soon as I take out the equals sign, it works. [22:32:55] any way to mask that? [22:34:46] Raazeer: {{R|1=[www....]}} [22:35:21] basically if the positional parameter has an = in the value, explicitly specify the param number [22:35:25] Skizzerz, I'll try that too, but I was just about to write that using a HTML entity also works and produces a correct link when entered. [22:35:58] sure, but what I said works in general :) [22:36:35] Skizzerz, And it is also so very much cleaner wiki code, so I'll tend towards using your solution. [23:10:09] Is it possible, whether via an extension or a native feature of MediaWiki, for individual users to hide media that occur in certain categories? [23:12:28] Like, if there were a category of informative images that were potentially disturbing (exempli gratia images taken from a warzone), a user particularly squeamish user could change a setting so that images in that category are hidden (or replaced with a "you have hidden this image because " and a link to actually view it) [23:14:39] hppavilion[1]: there is nothing like that which I am currently aware of [23:14:48] Hm [23:14:50] you could possibly write a Gadget to do that [23:15:14] but with a Gadget there would still be a small time period where the image shows up before the gadget can remove it [23:15:19] so extension is probably the best bet [23:16:32] (but then that will mess around with page caching) [23:17:19] if you're ok with editing the wiki markup as well (using a template instead of a direct [[File:]] embed), you can have it so that the default is the "hidden" message and then the gadget / site js expands it into the full image once it checks on stuff [23:17:49] (users without js enabled would need to click on the link, so they can still view the image) [23:18:06] that's about all I can think of offhand [23:32:05] I think there was some discussion about that time ago [23:32:18] I wouldn't be surprised if there was some code, too hppavilion[1] [23:33:26] Skizzerz: I'd like it to apply in category pages too, so that probably won't really work... [23:33:31] (wikimarkup editing) [23:33:37] I think the topics that prompted such descriptions were explicit images (eg. penis) and Muhammad ones [23:34:03] Platonides: I think it's blasphemy whether or not you look at it? [23:34:46] I guess it might be just for the one inserting it [23:35:40] I remember that being mentioned [23:35:55] in case that helps you find those discussions [23:36:13] it may easily have been 5 years ago