From ba739a143d1301d03e6e347fbf8e078efe6f39ad Mon Sep 17 00:00:00 2001 From: Ed Sanders Date: Wed, 26 Jan 2022 15:14:39 +0000 Subject: [PATCH] Always enable visual diff when diffmode=visual We already had a query string hack '?visualdiff' to enable the feature, but I think the pre-dated the diffmode param. Now we have the diffmode param, we can just enable the feature whenever diffmode=visual. This makes posting test links much simpler. Keepd the 'visualdiff' param for backwards compatibility. Change-Id: If777d7f2e6a3b1a1725f174d149cf9eab4535d85 --- includes/VisualEditorHooks.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/includes/VisualEditorHooks.php b/includes/VisualEditorHooks.php index 06f68c2201..862194abda 100644 --- a/includes/VisualEditorHooks.php +++ b/includes/VisualEditorHooks.php @@ -118,8 +118,10 @@ class VisualEditorHooks { $veConfig->get( 'VisualEditorEnableDiffPage' ) || // Enabled as user beta feature $userOptionsLookup->getOption( $user, 'visualeditor-visualdiffpage' ) || + // Enabled by query param (deprecated) + $output->getRequest()->getVal( 'visualdiff' ) !== null || // Enabled by query param - $output->getRequest()->getVal( 'visualdiff' ) !== null + $output->getRequest()->getVal( 'diffmode' ) === 'visual' ) ) { return; }