From 52db0af5cfaa5772fe72a7de1d06f733885dc494 Mon Sep 17 00:00:00 2001 From: Ed Sanders Date: Wed, 11 Oct 2023 16:55:46 +0100 Subject: [PATCH] OverflowMenus: Don't pass 'editable' data to reply button overflows 'editable' refers to the section being editable, and is only for use by heading items, not individual comments. Change-Id: I3fb5841609c40a928071cea8987cf035ade464c2 --- includes/CommentFormatter.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/includes/CommentFormatter.php b/includes/CommentFormatter.php index 7910fac0f..dd414842f 100644 --- a/includes/CommentFormatter.php +++ b/includes/CommentFormatter.php @@ -300,8 +300,7 @@ class CommentFormatter { $lastTimestamp->surroundContents( $link ); } } - $editable = DOMCompat::querySelector( $replyButtons, 'mw\\:editsection' ) !== null; - self::addOverflowMenuButton( $threadItem, $doc, $replyButtons, [ 'editable' => $editable ] ); + self::addOverflowMenuButton( $threadItem, $doc, $replyButtons ); } $range->insertNode( $startMarker ); @@ -748,7 +747,7 @@ class CommentFormatter { static function ( $matches ) use ( $contextSource ) { $overflowMenuData = json_decode( htmlspecialchars_decode( $matches[1] ), true ) ?? []; - $isSectionEditable = $overflowMenuData['editable']; + $isSectionEditable = $overflowMenuData['editable'] ?? false; // TODO: Remove the fallback to empty array after the parser cache is updated. $threadItem = $overflowMenuData['threadItem'] ?? []; $overflowMenuItems = [];