Try to resolve an issue where IndexDocumentBundles were sotring cound in duplicate locations that would get out of sync, a=chris

Chris Pollett [2022-08-14 01:Aug:th]
Try to resolve an issue where IndexDocumentBundles were sotring cound in duplicate locations that would get out of sync, a=chris
Filename
src/library/IndexDocumentBundle.php
diff --git a/src/library/IndexDocumentBundle.php b/src/library/IndexDocumentBundle.php
index 99828521f..ea0708f7b 100644
--- a/src/library/IndexDocumentBundle.php
+++ b/src/library/IndexDocumentBundle.php
@@ -1532,6 +1532,15 @@ class IndexDocumentBundle implements CrawlConstants
         $archive_info_path = $dir_name. "/" . self::ARCHIVE_INFO_FILE;
         if (file_exists($archive_info_path)) {
             $info = self::getArchiveInfo($dir_name);
+            $doc_folder =  $dir_name. "/" . self::DOCUMENTS_FOLDER;
+            if (file_exists($doc_folder)) {
+                $pdb_info = PartitionDocumentBundle::getParameterInfo(
+                    $doc_folder);
+                // avoid getting same data (_COUNTS) stored in two locations
+                if (!empty($info) && !empty($pdb_info)) {
+                    $info = array_key_diff($info, $pdb_info);
+                }
+            }
         }
         if (empty($info) || !is_array($info)) {
             $info = [];
ViewGit