[09:20:33] hey addshore! you around ? [09:20:44] ya [09:20:48] currently in a call though [09:20:56] if you wonder around enough you might find my face on someones laptop :p [09:21:10] alright :D addshore -- did you see https://phabricator.wikimedia.org/T138462 ?> [09:21:23] nope [09:21:35] but yeh, sounds good! [09:21:42] legoktm was telling me about how we could get this done using contenthandler [09:22:08] we were thinking of a rewrite. donno how difficult it would be though. legoktm has promised to help! [09:41:16] yup [09:41:23] is legoktm there? :p [09:41:32] addshore: he isssss [09:41:34] :D [09:41:42] then im sure you could all get it done this week ;) [10:23:48] legoktm: around ? [10:24:15] I could make the newsletter to create a new page( via the 'edit' API now ), and it did create a new page on creation too. [10:24:29] tonythomas: helping someone else right now, sorry [10:24:32] I think we will need to create all newsletters in a different namespace [10:24:41] legoktm: alright :) talk to you after lunch! [12:20:10] tonythomas: talk here :) your pm is too far down the list ;) [12:20:44] addshore: alright. pushing it now. it has the basic functionality [12:21:02] https://gerrit.wikimedia.org/r/295670 - jenkins might not like the missing qqq though [12:23:49] qgil: tonythomas oh hey [12:23:59] will try to reply soon [12:24:05] Glaisher: hey! Thank you! [12:24:17] we were working on this one - https://phabricator.wikimedia.org/T138462 [12:24:28] as pointed by legoktm late yesterday night. [12:24:40] I've been very busy with exams and stuff ad haven't been checking on wikimedia stuff this week [12:25:07] :o mine too just got over with! [12:25:33] T138462 looks like a maaajor change! :) [12:25:33] T138462: Convert Newlsetter to use ContentHandler - https://phabricator.wikimedia.org/T138462 [12:26:00] That would make history things a lot easier. [12:26:17] well. this came up when I was looking around on tracking the description edits [12:26:51] It would make https://gerrit.wikimedia.org/r/#/c/289720/ obsolete [12:26:58] and somehow legoktm shows me to /Special:CreateMassMessageList and then ... [12:27:20] alright ( but we should know this one should work out :D ) [12:27:36] I don't think I can help with CR because I'm way too busy :/ [12:28:03] Glaisher: thats alright. I hope we have addshore sparing few of his minutes [12:28:18] you might've a week of things piled up :D [12:29:31] true :P [12:30:08] addshore: I just pused in the qqq too. do you think we should go for a separate namespace ? [12:30:29] yeah, I can [12:30:37] I can't think of a reason not to* [12:31:39] Glaisher: okey. so this one will go to $title = Title::newFromText( trim( $input['name'] ) ); -- I should find out how I can enforce a namespace there [12:32:08] Use Title::makeTitleSafe() [12:32:18] okey. [12:32:30] Is that on Special:Newsletter? [12:33:00] Glaisher: in /SpecialNewsletterCreate.php https://gerrit.wikimedia.org/r/#/c/295670/2/includes/specials/SpecialNewsletterCreate.php [12:33:35] ah okay [12:34:22] Glaisher: in the $ns param, I can just give 'Newsletter' right ? [12:34:35] there are places I see things like NS_something [12:34:43] You should define a constant NS_NEWSLETTER or sth like that [12:34:59] okey. just like that :) [12:37:08] tonythomas: I just saw https://gerrit.wikimedia.org/r/295503 as well.. It also shouldn't be needed if we start to use ContentHandler [12:37:25] yeah :] [12:38:26] killed [12:46:47] Glaisher: I couldnt find how to create a new namespace anywhere in https://doc.wikimedia.org/mediawiki-core/1.24.5/php/MWNamespace_8php_source.html class. Is it the right way ? as the makeTitleSafe expects an int, the namespace_id or something like that. I should create the namespace well before ? [12:48:14] ah. I got something from here https://www.mediawiki.org/wiki/Manual:Using_custom_namespaces#Creating_a_custom_namespace [12:48:21] looks like the int is some random number. okey [12:48:24] tonythomas: You can use $wgExtraNamespaces and then define the NS_* constants in the registration function [12:48:44] tonythomas: and the talk page id should be main id +1 [12:48:56] okey. hmm. alright. let me check [12:49:11] oh.. that page says registration function is too late [12:49:53] apparently we can now use extension.json for it [12:49:59] https://www.mediawiki.org/wiki/Manual:Using_custom_namespaces#In_extensions [12:50:38] I don't have time to look at it in detail but addshore and legoktm would be able to help with this I guess [12:50:51] hi Glaisher :) [12:50:59] hi :) [12:51:06] we were just talking about you! [12:51:17] oh :D [12:51:22] Glaisher: you're amazing - ajr [12:51:52] hehe, say thanks from me :) [12:52:08] he's sitting next to me - he actually typed that :P [12:52:22] haha [12:52:39] well https://www.mediawiki.org/wiki/Manual:Using_custom_namespaces#In_extensions doesnt come with an example though! [12:53:29] you can look at the Gadgets extension for an example [12:54:26] legoktm: thank you! [12:54:50] letme update the docs there with this one. [13:46:43] legoktm: rather than copying the entire code in https://github.com/wikimedia/mediawiki-extensions-Newsletter/blob/master/includes/specials/SpecialNewsletter.php#L189 to the fillParserOutput(), is there a better way to maybe call it inside the contenthandler ? [13:54:59] tonythomas: no...but you'd get rid of the special page part [13:56:59] legoktm: well. I try testing by putting up an echo in protected function fillParserOutput( Title $title, $revId, ParserOptions $options, $generateHtml, ParserOutput &$output ) { } but it seems not be coming up :( [13:57:13] er [13:57:14] can't do that [13:57:24] you have to do $output->setText($html) [13:57:35] oh - I was just checking if that function is even getting called. [13:57:37] okey will try that [13:58:01] var_dump will work better than echo [13:58:31] legoktm: true. let me try all those :) [13:58:55] so - this Special code, needs now to be inside the fillParserOutput() if I get it correct, right ? [15:03:23] legoktm: need help with a piece of code here. I need to replace $this->getPageTitle( $id . '/' . self::NEWSLETTER_UNSUBSCRIBE )->getFullURL() ) in our new approach, and it should be linking to the SpecialPage. $this->getPageTitle wont work anymore, as we are not in the special page [15:03:48] how will I write that to get the link to the correct newsletter ? Like /Special:Newsletter/12/unsubscribe ? [15:04:07] tonythomas: SpecialPage::getTitleFor('name of special page', $id . '/' . SpecialNewsletter::NEWSLETTER_UNSUBSCRIBE ) [15:04:13] I need the url there, as it should go to 'href' => [15:04:16] thank you :D [15:04:29] that gives you a title object [15:05:00] legoktm: alright. I'm sure I will be able to get the url out of it! [16:17:34] legoktm: still around ? so from this point, we should remove the 'manage' button, and allow the publisher to edit the page directly ( with the edit button on top ? ) [16:18:26] currently the 'Manage' button leads to the HTMLForm in the special page [16:25:16] tonythomas: sounds good [16:25:48] legoktm: and from what I can see https://github.com/wikimedia/mediawiki-extensions-MassMessage/blob/45de220da438d3065da5573595b92f581e2531f9/MassMessage.hooks.php#L206 is the way to override the Edit button [16:25:50] sigh! [16:26:30] "SkinTemplateNavigation" [16:26:50] yeah [16:26:56] going offline now-ish [16:27:16] legoktm: alright!