Merge "Add forward compat hack for getBlockInfo/getBlockAsResultStructure"

This commit is contained in:
jenkins-bot 2019-05-11 01:42:27 +00:00 committed by Gerrit Code Review
commit fdcca9a8f8

View file

@ -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 <https://gerrit.wikimedia.org/r/c/mediawiki/core/+/506945>.
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