if ( $titleObj->isRedirect() ) {
$oldTitle = $titleObj;
- $titles = Revision::newFromTitle( $oldTitle )->getContent( Revision::FOR_THIS_USER )->getRedirectChain();
+ $titles = Revision::newFromTitle( $oldTitle, false, Revision::READ_LATEST )
+ ->getContent( Revision::FOR_THIS_USER )
+ ->getRedirectChain();
// array_shift( $titles );
$redirValues = array();
{
$content = $pageObj->getContent();
+ // @todo: Add support for appending/prepending to the Content interface
+
if ( !( $content instanceof TextContent ) ) {
- // @todo: ContentHandler should have an isFlat() method or some such
- // @todo: XXX: or perhaps there should be Content::append(), Content::prepend()
- // @todo: ...and Content::supportsConcatenation()
$mode = $contentHandler->getModelID();
$this->dieUsage( "Can't append to pages using content model $mode", 'appendnotsupported' );
}
if ( !is_null( $params['summary'] ) ) {
$requestArray['wpSummary'] = $params['summary'];
}
-
+
if ( !is_null( $params['sectiontitle'] ) ) {
$requestArray['wpSectionTitle'] = $params['sectiontitle'];
}
$articleObject = new Article( $titleObj );
$ep = new EditPage( $articleObject );
+ // allow editing of non-textual content.
+ $ep->allowNonTextContent = true;
+
$ep->setContextTitle( $titleObj );
$ep->importFormData( $req );