* (bug 41899) A PHP notice no longer occurs when using the "rvcontinue" API parameter.
* (bug 42036) Account creation emails now contain canonical (not
protocol-relative) URLs.
+* (bug 41990) Fix regression: API edit with redirect=true and lacking
+ starttimestamp and basetimestamp should not cause an edit conflict.
=== API changes in 1.21 ===
* prop=revisions can now report the contentmodel and contentformat, see docs/contenthandler.txt
$this->dieUsageMsg( array( 'invalidtitle', $params['title'] ) );
}
- if ( !isset( $params['contentmodel'] ) || $params['contentmodel'] == '' ) {
- $contentHandler = $pageObj->getContentHandler();
- } else {
- $contentHandler = ContentHandler::getForModelID( $params['contentmodel'] );
- }
-
- // @todo ask handler whether direct editing is supported at all! make allowFlatEdit() method or some such
-
- if ( !isset( $params['contentformat'] ) || $params['contentformat'] == '' ) {
- $params['contentformat'] = $contentHandler->getDefaultFormat();
- }
-
- $contentFormat = $params['contentformat'];
-
- if ( !$contentHandler->isSupportedFormat( $contentFormat ) ) {
- $name = $titleObj->getPrefixedDBkey();
- $model = $contentHandler->getModelID();
-
- $this->dieUsage( "The requested format $contentFormat is not supported for content model ".
- " $model used by $name", 'badformat' );
- }
-
$apiResult = $this->getResult();
if ( $params['redirect'] ) {
$apiResult->setIndexedTagName( $redirValues, 'r' );
$apiResult->addValue( null, 'redirects', $redirValues );
+
+ // Since the page changed, update $pageObj
+ $pageObj = WikiPage::factory( $titleObj );
}
}
+ if ( !isset( $params['contentmodel'] ) || $params['contentmodel'] == '' ) {
+ $contentHandler = $pageObj->getContentHandler();
+ } else {
+ $contentHandler = ContentHandler::getForModelID( $params['contentmodel'] );
+ }
+
+ // @todo ask handler whether direct editing is supported at all! make allowFlatEdit() method or some such
+
+ if ( !isset( $params['contentformat'] ) || $params['contentformat'] == '' ) {
+ $params['contentformat'] = $contentHandler->getDefaultFormat();
+ }
+
+ $contentFormat = $params['contentformat'];
+
+ if ( !$contentHandler->isSupportedFormat( $contentFormat ) ) {
+ $name = $titleObj->getPrefixedDBkey();
+ $model = $contentHandler->getModelID();
+
+ $this->dieUsage( "The requested format $contentFormat is not supported for content model ".
+ " $model used by $name", 'badformat' );
+ }
+
if ( $params['createonly'] && $titleObj->exists() ) {
$this->dieUsageMsg( 'createonly-exists' );
}