[09:18:57] Hmm, how come exceptions don't seem to be pretty (E.g. formatted with the skin) anymore? [09:19:41] Ah, its only MWException that is broken, but Exception seems fine [09:19:47] That's the opposite of how it used to be! [09:21:55] meh, filed https://phabricator.wikimedia.org/T246619 [09:53:54] Hi, I want to append some string before saving an article. So I use public static function onPageContentSave( $wikiPage, $user, $content, &$summary, [09:53:55] ); [09:54:23] But the new content is not set? What am I doing wrong? [10:01:09] daniel123445: You need to register it as a hook [10:01:21] in extension.json [10:02:39] I did [10:03:50] "Hooks": { "OutputPageBeforeHTML": "MyExtensionHooks::onOutputPageBeforeHTML", "PageContentSave": "MyExtensionHooks::onPageContentSave", [10:04:08] bawolff sorry forgot to mention that [10:04:28] Is your hook inside a class named MyExtensionHooks? [10:04:49] Have you added wfLoadExtension( 'Extension name here' ); to LocalSettings.php [10:04:49] the hook is working like it should and I also get the content, but I can't give the new content to the article [10:05:08] oh ok [10:05:17] How are you trying to set the content? [10:05:39] $content = ContentHandler::makeContent( $text, $wikiPage->getTitle() ); [10:06:16] Ah, in your method signature you need it to be onPageContentSave( $wikiPage, $user, &$content, &$summary, [10:06:49] I also tried that, let me check it again [10:06:56] Although i'm not sure if that fully works [10:07:20] As i think this hook runs after the content is supposed to be decided [10:08:28] Yeah, its unclear to me if $content is allowed to be replaced [10:08:33] It's the request to save, onPageContentSaveComplete comes when the page save is complete [10:08:59] onPageContentSave is before its saved to the db, but after a bunch of stuff is already done to the content [10:09:04] so I thought onPageContentSave is the right hook todo it [10:09:11] Hmm, is there a hook for PST, that might be a better plae [10:09:13] *place [10:10:09] so you think the request got already out to the db? [10:11:41] I know of onOutputPageBeforeHTML but that hook is every time called when a page is shown [10:11:48] so I don't want that [10:12:41] daniel123445: no, its not in the db, I'm just not sure all the variables would be updated right from that hook [10:13:17] hmm do you have an idea what I also could try? [10:14:17] but i'm not sure, i might be wrong [10:15:51] daniel123445: Is it the wikitext you want to modify, or the html output, because for html output you can do ParserAfterStrip [10:16:13] For wikitext, the cleanest way i guess is a ContentHandler subclass, but that requires making an entire new Content handler [10:18:00] One reason its kind of bad to modify from PageContentSave, is at that point, all the categories and links have already been calculated, and put into database updated, so if you changed any of that it would be out of sync [10:18:11] making a new ContentHandler is to hard for me :( [10:18:41] yeah, that would be a very heavy thing to do just for what you're trying to achieve [10:19:30] I will also try EditPage::attemptSave maybe I am lucky :) [10:19:48] Thank you bawolff I will come back later [10:21:09] Hmm, i was just going to suggest EditPage::attemptSave and modify $editpage->textbox1 [13:08:23] hi, reading into creating a mediawiki cluster. Part of it looks simple, like the database setup [13:08:43] but what is unclear to me is how images can be dealt with [13:55:40] akoopal, feel free to elaborate, and link to what you're reading [14:37:12] andre__: I started of with https://www.mediawiki.org/wiki/Manual:MediaWiki_architecture [14:37:48] if I think about it, most bits seems clear, but as the images are on a simple mediawiki on local disk, not sure about that part [15:47:55] Hi guys, I want to display the edits and new created articles of an user. And I want to get the data out of the db. So for example I found out you can do $total_pages = $dbr->fetchObject($dbr->query("SELECT COUNT(*) as total FROM page")); and then $total_pages->total [15:48:23] can you do that for the edits new articles in the last 30 days? And how? [15:48:47] Do I need to look at the revison table? [15:53:28] Almost certainly [15:53:43] Recent changes table might be able to help, but the period the data stays in that table depends on the wiki [15:59:01] Reedy how do I find out how long the data is available? Do you have a better idea how to do it? [15:59:43] $wgRCMaxAge [15:59:57] By default it's 90 days [16:00:57] (90*24*3600) [16:02:18] $wgRCMaxAge is not set in the LocalSettings.php so I suppose it's then 90 day. So that is great [16:02:33] now how do I get the information I need [16:04:40] Reedy so the table has rc_user, rc_user_text, rc_timestamp and rc_title [16:05:02] The name of the page that was subject to change, with the namespace stripped. This field stores information in text form. Corresponds to log_title, in the case of log actions. [16:05:26] so does it mean that this is for edit and also new inserted articles? [16:06:08] aah ok I see rc_new [16:06:14] If the value for this field is 1, then this edit created a page; it is 0 otherwise. [16:06:29] So I can check for every edit this value [16:07:43] Now a last stupid question Reedy how do I access the stuff? Is there a help / tutorial page? [16:08:50] sorry, I'm a little busy for the next 50 minutes or so [16:11:44] andre__: hey, can you enlighten me about phab's 2fa stuff? it's asking for a token (a wikitech one? I have too many 2fa accounts). But it doesn't work. My 2fa settings tell me to remove and re-add the auth factor, but when I try, it asks for an access token. Which it then tells me is invalid... [16:11:57] I must be missing something obvious... [16:12:11] duesen: phab is all its own [16:12:14] no wikitech, that's separate [16:12:20] duesen, which URL are you on? [16:12:28] https://phabricator.wikimedia.org/settings/user/daniel/page/multifactor/ [16:12:50] My phne doesn't know about the factor for phab [16:13:07] Heh, so what have you been using so far? :) [16:13:26] phab hasn't asked be for 2fa so far [16:13:26] Google Authenticator, Authy, FreeOTP? [16:13:46] I'm using the LastPass app [16:14:38] Reedy no problem I'm staying in the channel, maybe you can answer later or I ask later. I am welcome for every help. know 0 about sql D: [16:14:56] I don't understand how phab is doing this. Usually, the auth factors are bound to a device [16:15:20] how would i even get a new factor for use with a new phone? [16:15:57] andre__: Phab says: You can simply remove the old factor and then click "+ Add Auth Factor" to replace it. [16:16:06] except that it asks me for a token when I try that :P [16:16:18] "To enter high security mode, confirm your credentials:" [16:16:19] yay [16:17:50] duesen: So that page does NOT list any existing Authentication factors? [16:18:52] duesen: On my private Phab account without Phab 2FA set up yet, I have no Auth Factors listed. I click "Add Auth Factor". I get a dialog "Choose Factor Type". I choose "Mobile Phone App (TOTP)". I click "Continue" and get a code to scan. [16:19:22] andre__: it does list one factor. [16:19:52] andre__: no idea what i set this up with, my LastPass account doesn't know about it. [16:20:08] No idea. :) Remove that factor, and try to add a new one? [16:20:24] I can't remove it, it asks for a token to do that [16:20:27] same for adding a new one [16:21:33] duesen, if you have no 2FA device around I could strip your 2FA completely, so you can re-set up [16:21:52] Would prefer a video call for that though, to verify, as IRC nicks aren't too safe [16:22:21] andre__: sure, call me up [16:22:51] ...and tell me where :) best send a link [16:24:07] duesen, Google Hangout? [16:25:51] andre__: calling now [16:29:35] alright, sorted out [16:33:17] andre__: now phab is down :P [16:33:23] did we kill it?! [16:33:37] u borke it? WFM [16:34:19] dead for me too [16:34:57] not quite dead. but extremely slow [16:35:01] timing out for me [16:35:05] took a couple of minutes to load a page [16:35:06] and back? [16:35:33] but yes, it is slow and intermittent [16:36:02] already brought up in operations channel [16:36:09] andre__: random guess: resetting 2fa kills all caches. for no good reason [16:36:56] it's not only phab [16:36:59] bigger issue [16:37:08] esams probably [18:10:20] Hi again, I asked this morning a question. I want to append a string when a article is being saved. What is the last possible hook for that? I tried onPageContentSave and $text = ContentHandler::getContentText($content); $content = ContentHandler::makeContent( $text, $wikiPage->getTitle() ); [18:10:27] but it is not working [18:11:05] Can someone help [18:14:08] the hook to do that cleanly no longer works [18:14:21] I haven't found a suitable replacement [18:14:55] ooh so there is no hook for that? [18:15:12] so is onPageContentSave wrong [18:15:22] if there is, I'm unaware of it, and I've went digging because I ran into the exact same issue you're running into a few months ago :) [18:15:44] ooh [18:16:00] that used to be the correct hook, but the underlying code on the mw side of things changed so that overriding the content in that hook no longer does anything [18:16:20] damn [18:16:53] will there be a fix in the new 1.35? [18:17:00] if you know? [18:17:10] doubtful [18:17:34] that doesn't sound that good [18:18:09] can you re-work your extension to operate in a different fashion? [18:18:14] what did you wanted to achieve Skizzerz some month ago? If I may ask [18:18:54] no Skizzer, I wanted to append a tag, if the user forgot to include it [18:18:59] (it's what I ended up doing. my extension automatically appended some category tags to image uploads. I worked around it by making a parser function to do that instead, and then having the parser function pre-populate via the upload form template) [18:19:59] my recommendation would be to file a task on phabricator asking for a replacement (if there isn't one already) [18:20:59] at the moment I use onOutputPageBeforeHTML but if the last element is a list-element then it's displayed a bit wrong [18:21:46] I suspect that the onOutputPageBeforeHTML is to early for the inserted tag [18:24:05] very sad, the explanations and how tos on mediawiki are realy hard to understand and often not 100% correct and then also the hook page is wrong [18:24:48] to code stuff for mediawiki is realy ... challenging [18:24:55] :) [18:52:30] daniel123446: isn't it [19:44:20] I'm trying to set MediaWiki up with the VisualEditor but I'm having some trouble with Parsoid. When I try to edit a page, I get this: Error loading data from server: apierror-visualeditor-docserver-http: HTTP 404 [19:45:07] In my LocalSettings.php, I have MediaWiki looking for Parsoid at localhost:8142 and curling that address works perfectly fine [20:02:16] What's the best way to find out when a Special: page was modified? It looks like at some point transcluding Special:PrefixIndex went from giving you a table to giving you a list. It should have happened sometime after 1.19 but I don't see it mentioned anywhere [20:02:55] wychmire: you'd have to look through the release notes [20:03:47] I ctrl+f'd my way through all the MediaWiki 1.x.x pages on mediawiki.org, is there a better place? [20:04:06] the search bar? ;) [20:04:32] it's possible it wasn't mentioned in the release notes, however, in which case it may require digging through the code history itself to discover when it happened [20:05:48] I just found Release notes/1.x.x which might be a little more helpful. I'll check through those and if it still doesn't mention them I'll come back, thanks for the suggestions so far [20:11:06] Well it wasn't totally fruitless, I now it was after 1.23 since that release includes "On Special:PrefixIndex, a table#mw-prefixindex-list-table was changed to table.mw-prefixindex-list-table" [20:11:34] what's the best wat to search through the code history? git clone and grep through the log? [20:11:41] best way* [20:12:19] if you know the file in question you're looking at, you can git blame that file [20:12:33] and look at when the lines you care about changed and what that change was [20:12:41] if you don't know, then grepping the history would be better [20:29:32] You can also search for tasks and patches on Phabricator [20:32:29] Found it! It was MediaWiki 1.27. https://gerrit.wikimedia.org/r/#/c/mediawiki/core/+/247053/ [20:32:43] not sure why it's never mentioned in the release notes [20:32:55] AntiComposite: that only helps if there was a task for it in the first place :) [20:33:00] although in this case it looks like there was [20:33:36] It is here https://www.mediawiki.org/wiki/MediaWiki_1.27/wmf.4 and here https://www.mediawiki.org/wiki/MediaWiki_1.27/wmf.4/Changelog but not on MediaWiki 1.27 or on the Release notes/1.27 pages