If someone did $f = new ArchivedFile( null, 10 ); (ie load an
archived file based on id), $f->getTitle() would always return
false. We should populate the title when loading properties
from the db to prevent this. Having $f->getTitle() return
false only sometimes is sketchy.
Change-Id: Ia9d25d6b159aa45696c318d8c4a8ef0adffb3e47
// old row, populate from key
$this->sha1 = LocalRepo::getHashFromKey( $this->key );
}
+ if ( !$this->title ) {
+ $this->title = Title::makeTitleSafe( NS_FILE, $row->fa_name );
+ }
}
/**
* @return Title
*/
public function getTitle() {
+ if ( !$this->title ) {
+ $this->load();
+ }
return $this->title;
}