From 5957ac55dfe568d813f72106000fd97cf8816fef Mon Sep 17 00:00:00 2001 From: Ed Sanders Date: Mon, 25 Mar 2024 18:26:53 +0000 Subject: [PATCH] Pass through dtenable from main request query string Instead of passing dtenable=1 unconditionally for API requests. Bug: T360863 Change-Id: I42c651558d95a88eaf6006b6509caa4e41df8464 --- modules/CommentController.js | 5 ++--- modules/controller.js | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/modules/CommentController.js b/modules/CommentController.js index b47f2dda7..d5d7ba7b7 100644 --- a/modules/CommentController.js +++ b/modules/CommentController.js @@ -442,9 +442,8 @@ CommentController.prototype.getApiQuery = function ( pageName, checkboxes ) { 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', + // Pass through dtenable query string param from original request + dtenable: new URLSearchParams( location.search ).get( 'dtenable' ) ? '1' : undefined, dttags: tags.join( ',' ) }; diff --git a/modules/controller.js b/modules/controller.js index 4e3c213e0..ceb74878c 100644 --- a/modules/controller.js +++ b/modules/controller.js @@ -788,9 +788,8 @@ function refreshPageContents( oldId ) { useskin: mw.config.get( 'skin' ), mobileformat: OO.ui.isMobile(), 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', + // Pass through dtenable query string param from original request + dtenable: new URLSearchParams( location.search ).get( 'dtenable' ) ? '1' : undefined, prop: [ 'text', 'revid', 'categorieshtml', 'sections', 'displaytitle', 'subtitle', 'modules', 'jsconfigvars' ], page: !oldId ? mw.config.get( 'wgRelevantPageName' ) : undefined, oldid: oldId || undefined