Running cargoRecreateData.php without --table can leave tables empty or missing rows. Since c7f4f3c, $this->handledPageIds is kept for the whole run and never reset between tables, so a page that stores data in multiple tables is only parsed for the first one. Because #cargo_store only saves data for the table currently being recreated, the later tables silently lose that page's rows. On our Wiki, this left two tables completely empty after a full run, running each with --table restored them. This is fixed by resetting $this->handledPageIds to an empty array in recreateAllDataForTable().
diff --- a/maintenance/cargoRecreateData.php +++ b/maintenance/cargoRecreateData.php @@ -161,6 +161,7 @@ class CargoRecreateData extends Maintenance { $templatesForThisTable = array_merge( $templatesThatDeclareThisTable, $templatesThatAttachToThisTable ); $wikiPageFactory = MediaWikiServices::getInstance()->getWikiPageFactory(); + $this->handledPageIds = []; foreach ( $templatesForThisTable as $templatePageID ) { $templateTitle = Title::newFromID( $templatePageID ); if ( $templateTitle == null ) {
I want to disclose that I did stumble across this bug/fix with the help of AI but I have reviewed it fully and tested myself.