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:
Universal Omega 2021-10-19 06:51:38 +00:00
parent 66e58d1ea7
commit 2708a82ea0
3 changed files with 11 additions and 3 deletions

View file

@ -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

View file

@ -287,7 +287,7 @@ class CheckStorage {
break;
}
if ( $className == 'historyblobstub' ) {
$concatBlobs[$stubObj->mOldId][] = $oldId;
$concatBlobs[$stubObj->getLocation()][] = $oldId;
} else {
$curIds[$stubObj->mCurId][] = $oldId;
}

View file

@ -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