Add BC hack for some 2009 AbuseLog entries causing a fatal error

Some AbuseLog entries from 2009 are missing the 'timestamp' parameter
used to compute the old wikitext of the page. This was only used for a
short amount of time before
https://phabricator.wikimedia.org/rEABFd1d27eede6536067c5180b2515ea937d71525d4d.

Nowadays, it's causing a fatal error when we try to migrate the affected
entries, see T246539#6388362.

Since we only have a Title available, we cannot rebuild what the old
wikitext would look like, so a placeholder text is used (this should
hopefully be clearer than showing an empty string).

Bug: T246539
Change-Id: I5230f2fdc84da121728a5a75da458f1a4ef1ecd3
This commit is contained in:
Daimona Eaytoy 2020-08-19 12:33:48 +02:00
parent cb9ed4a957
commit 5faea5ee58

View file

@ -481,6 +481,11 @@ class AFComputedVariable {
break;
case 'revision-text-by-timestamp':
$timestamp = $parameters['timestamp'];
if ( $timestamp === null ) {
// Temporary BC for T246539#6388362
$result = '[Revision text not available]';
break;
}
$title = $this->buildTitle( $parameters['namespace'], $parameters['title'] );
$revRec = $services
->getRevisionStore()