if ( isset( $row->ar_text ) && !$row->ar_text_id ) {
// Pre-1.5 ar_text row
$attribs['text'] = self::getRevisionText( $row, 'ar_' );
+ if ( $attribs['text'] === false ) {
+ throw new MWException( 'Unable to load text from archive row (possibly bug 22624)' );
+ }
}
return new self( $attribs );
}
* @param $row Mixed: either a database row or an array
* @access private
*/
- function Revision( $row ) {
+ function __construct( $row ) {
if( is_object( $row ) ) {
$this->mId = intval( $row->rev_id );
$this->mPage = intval( $row->rev_page );
if( isset( $row->page_latest ) ) {
$this->mCurrent = ( $row->rev_id == $row->page_latest );
- $this->mTitle = Title::makeTitle( $row->page_namespace, $row->page_title );
- $this->mTitle->resetArticleID( $this->mPage );
+ $this->mTitle = Title::newFromRow( $row );
} else {
$this->mCurrent = false;
$this->mTitle = null;
/**
* Alias for getText(Revision::FOR_THIS_USER)
*
+ * @deprecated
* @return String
*/
public function revText() {
* Insert a new revision into the database, returning the new revision ID
* number on success and dies horribly on failure.
*
- * @param $dbw DatabaseBase (master connection)
+ * @param $dbw DatabaseBase: (master connection)
* @return Integer
*/
public function insertOn( $dbw ) {
public static function userCanBitfield( $bitfield, $field ) {
if( $bitfield & $field ) { // aspect is deleted
global $wgUser;
- $permission = '';
if ( $bitfield & self::DELETED_RESTRICTED ) {
$permission = 'suppressrevision';
} elseif ( $field & self::DELETED_TEXT ) {