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
This commit is contained in:
Ed Sanders 2023-10-11 16:55:46 +01:00
parent fb8aaca7a7
commit 52db0af5cf

View file

@ -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 = [];