mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-15 18:39:52 +00:00
Merge "Use the latest revision's timestamp for basetimestamp"
This commit is contained in:
commit
68c9dcc693
|
@ -20,7 +20,8 @@ class ApiVisualEditor extends ApiBase {
|
||||||
$parserParams['oldid'] = ''; // Parsoid wants empty string rather than zero
|
$parserParams['oldid'] = ''; // Parsoid wants empty string rather than zero
|
||||||
}
|
}
|
||||||
$revision = Revision::newFromId( $parserParams['oldid'] );
|
$revision = Revision::newFromId( $parserParams['oldid'] );
|
||||||
if ( $revision === null ) {
|
$latestRevision = Revision::newFromTitle( $title );
|
||||||
|
if ( $revision === null || $latestRevision === null ) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$restoring = !$revision->isCurrent();
|
$restoring = !$revision->isCurrent();
|
||||||
|
@ -60,7 +61,7 @@ class ApiVisualEditor extends ApiBase {
|
||||||
if ( $content === false ) {
|
if ( $content === false ) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$timestamp = $revision->getTimestamp();
|
$timestamp = $latestRevision->getTimestamp();
|
||||||
} else {
|
} else {
|
||||||
$content = '';
|
$content = '';
|
||||||
$timestamp = wfTimestampNow();
|
$timestamp = wfTimestampNow();
|
||||||
|
|
Loading…
Reference in a new issue