Skip to content

Commit

Permalink
Merge pull request #108 from internetarchive/hot-fix
Browse files Browse the repository at this point in the history
More migration fixes
  • Loading branch information
cyberpower678 authored Sep 22, 2023
2 parents 1249152 + db91703 commit 91ec43d
Show file tree
Hide file tree
Showing 2 changed files with 2,413 additions and 2,412 deletions.
16 changes: 8 additions & 8 deletions app/src/Core/APII.php
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,8 @@ public static function getBatchText( $objects, $objectType = 'pagetitle', &$retu
) {
$returnArray = [];

$batch = $objects;

while( !empty( $objects ) ) {
$queryArray = [
'action' => 'query',
Expand All @@ -245,12 +247,10 @@ public static function getBatchText( $objects, $objectType = 'pagetitle', &$retu

switch( $objectType ) {
case 'pagetitle':
if( !isset( $batch ) ) $queryArray['titles'] = implode( '|', $objects );
else $queryArray['titles'] = implode( '|', $batch );
$queryArray['titles'] = implode( '|', $batch );
break;
case 'pageid':
if( !isset( $batch ) ) $queryArray['pageids'] = implode( '|', $objects );
else $queryArray['pageids'] = implode( '|', $batch );
$queryArray['pageids'] = implode( '|', $batch );
break;
default:
return false;
Expand All @@ -271,7 +271,7 @@ public static function getBatchText( $objects, $objectType = 'pagetitle', &$retu
'cm' => "APII::getBatchText()"
],
'aggregation_fields' => [
'batch_size' => @count( $batch )
'batch_size' => count( $batch )
]
];
$parseData =
Expand Down Expand Up @@ -1431,9 +1431,9 @@ public static function getTemplateData( $templates, $force = false ) {
unset( $toLookup[array_search( $pageData['title'], $toLookup )] );
}
} else {
foreach( $templates as $tid => $template ) {
self::$cachedTemplateData[self::getTemplateNamespaceName() . ":{$ttemplates[$tid]}"][0] = false;
self::$cachedTemplateData[self::getTemplateNamespaceName() . ":{$ttemplates[$tid]}"][1] = time();
foreach( $batch as $tid => $template ) {
self::$cachedTemplateData[$template][0] = false;
self::$cachedTemplateData[$template][1] = time();
}
}

Expand Down
Loading

0 comments on commit 91ec43d

Please sign in to comment.