From a15875e247c8f8ca79f9e26405c00cac380b0bb1 Mon Sep 17 00:00:00 2001 From: daniel Date: Thu, 9 May 2019 12:10:48 +0200 Subject: [PATCH] Add forward compat hack for getBlockInfo/getBlockAsResultStructure This is necessary to allow the unmitigated removal of ApiQueryUserInfo::getBlockInfo to be fixed. See discussion on I84ed21641c44b2f65. Change-Id: I9f40666a31bd4af50762c197c2ce5bf089a5e68c --- includes/ApiVisualEditor.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/includes/ApiVisualEditor.php b/includes/ApiVisualEditor.php index 94e1904719..dec204adf4 100644 --- a/includes/ApiVisualEditor.php +++ b/includes/ApiVisualEditor.php @@ -508,7 +508,18 @@ class ApiVisualEditor extends ApiBase { $block->getPermissionsError( $this->getContext() ) )->parseAsBlock(), ]; - $blockinfo = $this->getBlockInfo( $block ); + + // HACK: Forward compatibility with changed method name. + // Remove this when no longer needed. The old method name was used + // only for a few days/weeks during development of MW 1.34. + // See discussion on . + if ( method_exists( $this, 'getBlockInfo' ) ) { + // old name + $blockinfo = $this->getBlockInfo( $block ); + } else { + // new name + $blockinfo = $this->getBlockDetails( $block ); + } } // HACK: Build a fake EditPage so we can get checkboxes from it