Skip to content

Commit

Permalink
More migration fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
cyberpower678 committed Sep 22, 2023
1 parent 2e60bb3 commit db91703
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 db91703

Please sign in to comment.