mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-09-23 18:28:51 +00:00
Further cleanup for core API change
PS25 and later changed things around a fair bit, meaning the previous update needs some further updating. In some cases additional cleanup is also necessary for future core API changes. Bug: T96595 Change-Id: Iaac674f77079d29d42813fd69620bdce8905730f
This commit is contained in:
parent
5cf9798adb
commit
ccd2091f5d
|
@ -199,9 +199,10 @@ class ApiVisualEditor extends ApiBase {
|
|||
);
|
||||
$api->execute();
|
||||
if ( defined( 'ApiResult::META_CONTENT' ) ) {
|
||||
$result = $api->getResult()->getResultData();
|
||||
// Transform content nodes to '*'
|
||||
$result = ApiResult::transformForBC( $result );
|
||||
$result = $api->getResult()->getResultData( null, array(
|
||||
'BC' => array(), // Transform content nodes to '*'
|
||||
'Types' => array(), // Add back-compat subelements
|
||||
) );
|
||||
} else {
|
||||
$result = $api->getResultData();
|
||||
}
|
||||
|
@ -246,9 +247,11 @@ class ApiVisualEditor extends ApiBase {
|
|||
|
||||
$api->execute();
|
||||
if ( defined( 'ApiResult::META_CONTENT' ) ) {
|
||||
$result = $api->getResult()->getResultData();
|
||||
// Remove any metadata keys from the langlinks array
|
||||
$result = ApiResult::removeMetadata( $result );
|
||||
$result = $api->getResult()->getResultData( null, array(
|
||||
'BC' => array(), // Backwards-compatible structure transformations
|
||||
'Types' => array(), // Backwards-compatible structure transformations
|
||||
'Strip' => 'all', // Remove any metadata keys from the langlinks array
|
||||
) );
|
||||
} else {
|
||||
$result = $api->getResultData();
|
||||
}
|
||||
|
|
|
@ -78,11 +78,11 @@ class ApiVisualEditorEdit extends ApiVisualEditor {
|
|||
|
||||
$api->execute();
|
||||
if ( defined( 'ApiResult::META_CONTENT' ) ) {
|
||||
$result = $api->getResult()->getResultData();
|
||||
// Transform content nodes to '*'
|
||||
$result = ApiResult::transformForBC( $result );
|
||||
// Remove any metadata keys from the links array
|
||||
$result = ApiResult::removeMetadata( $result );
|
||||
$result = $api->getResult()->getResultData( null, array(
|
||||
'BC' => array(), // Transform content nodes to '*'
|
||||
'Types' => array(), // Add back-compat subelements
|
||||
'Strip' => 'all', // Remove any metadata keys from the links array
|
||||
) );
|
||||
} else {
|
||||
$result = $api->getResultData();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue