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

Chris Pollett [2022-08-14 02:Aug:th]
Try to resolve an issue where IndexDocumentBundles were sotring cound in duplicate locations that would get out of sync 2, a=chris
Filename
src/library/IndexDocumentBundle.php
src/library/PartitionDocumentBundle.php
diff --git a/src/library/IndexDocumentBundle.php b/src/library/IndexDocumentBundle.php
index ea0708f7b..6a093ce13 100644
--- a/src/library/IndexDocumentBundle.php
+++ b/src/library/IndexDocumentBundle.php
@@ -1515,6 +1515,7 @@ class IndexDocumentBundle implements CrawlConstants
         if (!is_array($table_info)) {
             $table_info = [];
         }
+        $info = array_diff_key($info, $table_info);
         $info = array_merge($table_info, $info);
         return $info;
     }
@@ -1532,19 +1533,22 @@ class IndexDocumentBundle implements CrawlConstants
         $archive_info_path = $dir_name. "/" . self::ARCHIVE_INFO_FILE;
         if (file_exists($archive_info_path)) {
             $info = self::getArchiveInfo($dir_name);
+        }
+        if (empty($info) || !is_array($info)) {
+            $info = [];
+        }
+        $pdb_info = [];
+        if (!empty($info)) {
             $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);
+                    $info = array_diff_key($info, $pdb_info);
                 }
             }
         }
-        if (empty($info) || !is_array($info)) {
-            $info = [];
-        }
         foreach ($update_info as $field => $value) {
             $info[$field] = $value;
         }
diff --git a/src/library/PartitionDocumentBundle.php b/src/library/PartitionDocumentBundle.php
index 5ae09c11f..e48ff2829 100644
--- a/src/library/PartitionDocumentBundle.php
+++ b/src/library/PartitionDocumentBundle.php
@@ -603,9 +603,6 @@ class PartitionDocumentBundle
     }
     /**
      * Save the operating parameters of this PartitionDocumentBundle
-     * @param bool $force saveParameter() does a sanity check before
-     *   writing either an empty parameter file or writing a SAVE_PARTITION
-     *   with value 0. If $force is true, this check is skipped.
      */
     public function saveParameters()
     {
ViewGit