HistoryBlobStub: add getLocation() to get $mOldId
For use in the checkStorage and resolveStubs maintenance scripts, in order to fix them. Follows-Up: Id1f530c2c8ec1171615f726dc7446431ee7ca8fe Change-Id: Iade3d1660f2b7db62f829f5e5ca94372614ae7e5
This commit is contained in:
parent
66e58d1ea7
commit
2708a82ea0
3 changed files with 11 additions and 3 deletions
|
|
@ -60,6 +60,14 @@ class HistoryBlobStub {
|
|||
$this->mOldId = $id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the location of the main object
|
||||
* @return int
|
||||
*/
|
||||
public function getLocation() {
|
||||
return $this->mOldId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the location (old_id) of the referring object
|
||||
* @param string $id
|
||||
|
|
|
|||
|
|
@ -287,7 +287,7 @@ class CheckStorage {
|
|||
break;
|
||||
}
|
||||
if ( $className == 'historyblobstub' ) {
|
||||
$concatBlobs[$stubObj->mOldId][] = $oldId;
|
||||
$concatBlobs[$stubObj->getLocation()][] = $oldId;
|
||||
} else {
|
||||
$curIds[$stubObj->mCurId][] = $oldId;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ function resolveStub( $id, $stubText, $flags ) {
|
|||
'text',
|
||||
[ 'old_text' ],
|
||||
[
|
||||
'old_id' => $stub->mOldId,
|
||||
'old_id' => $stub->getLocation(),
|
||||
'old_flags' . $dbr->buildLike( $dbr->anyString(), 'external', $dbr->anyString() )
|
||||
],
|
||||
$fname
|
||||
|
|
@ -113,7 +113,7 @@ function resolveStub( $id, $stubText, $flags ) {
|
|||
$dbw->update( 'text',
|
||||
[ /* SET */
|
||||
'old_flags' => $newFlags,
|
||||
'old_text' => $externalRow->old_text . '/' . $stub->mHash
|
||||
'old_text' => $externalRow->old_text . '/' . $stub->getHash()
|
||||
],
|
||||
[ /* WHERE */
|
||||
'old_id' => $id
|
||||
|
|
|
|||
Loading…
Reference in a new issue