Fix displaying reply links after posting a reply with dtenable=1

Bug: T267847
Change-Id: Ifb59cb942b673d9abcab563e6bc27fa1f6d5e9d7
This commit is contained in:
Bartosz Dziewoński 2020-11-18 19:19:06 +01:00
parent 3b9ba82436
commit c17a076382
3 changed files with 10 additions and 0 deletions

View file

@ -79,6 +79,10 @@ class Hooks {
if ( $output->getRequest()->getVal( 'dtenable' ) ) {
return true;
}
// Extra hack for parses from API, where this parameter isn't passed to derivative requests
if ( RequestContext::getMain()->getRequest()->getVal( 'dtenable' ) ) {
return true;
}
$user = $output->getUser();
$services = MediaWikiServices::getInstance();

View file

@ -252,6 +252,9 @@ CommentController.prototype.save = function ( comment, pageName ) {
assert: mw.user.isAnon() ? 'anon' : 'user',
assertuser: mw.user.getName() || undefined,
uselang: mw.config.get( 'wgUserLanguage' ),
// HACK: Always display reply links afterwards, ignoring preferences etc., in case this was
// a page view with reply links forced with ?dtenable=1 or otherwise
dtenable: '1',
dttags: [
'discussiontools',
'discussiontools-reply',

View file

@ -307,6 +307,9 @@ function update( data, comment, pageName, replyWidget ) {
// adding our reply links in the HTML (T266195)
useskin: mw.config.get( 'skin' ),
uselang: mw.config.get( 'wgUserLanguage' ),
// HACK: Always display reply links afterwards, ignoring preferences etc., in case this was
// a page view with reply links forced with ?dtenable=1 or otherwise
dtenable: '1',
prop: [ 'text', 'modules', 'jsconfigvars' ],
page: mw.config.get( 'wgRelevantPageName' )
} );