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 );
}
* WARNING: Timestamps may in some circumstances not be unique,
* so this isn't the best key to use.
*
- * @param $db Database
+ * @param $db DatabaseBase
* @param $title Title
* @param $timestamp String
* @return Revision or null
* Return the list of revision fields that should be selected to create
* a new revision.
*/
- static function selectFields() {
+ public static function selectFields() {
return array(
'rev_id',
'rev_page',
* @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;
* @return String
*/
public function revText() {
+ wfDeprecated();
return $this->getText( self::FOR_THIS_USER );
}
* 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 ) {