From: spalmstr Date: Tue, 21 Nov 2017 18:19:28 +0000 (+0000) Subject: CRM-21001 X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=f3490f40bc47858a7aea8f9d045c9a12423d5702;p=civicrm-core.git CRM-21001 --- diff --git a/CRM/Core/BAO/SchemaHandler.php b/CRM/Core/BAO/SchemaHandler.php index efae63a64e..6cec729fad 100644 --- a/CRM/Core/BAO/SchemaHandler.php +++ b/CRM/Core/BAO/SchemaHandler.php @@ -713,6 +713,7 @@ MODIFY {$columnName} varchar( $length ) $requiredSigs = $existingSigs = array(); // Get the indices defined (originally) in the xml files $requiredIndices = CRM_Core_DAO_AllCoreTables::indices(); + $reqSigs = array(); foreach ($requiredIndices as $table => $indices) { $reqSigs[] = CRM_Utils_Array::collect('sig', $indices); } @@ -720,6 +721,7 @@ MODIFY {$columnName} varchar( $length ) // Get the indices in the database $existingIndices = CRM_Core_BAO_SchemaHandler::getIndexes(array_keys($requiredIndices)); + $extSigs = array(); foreach ($existingIndices as $table => $indices) { CRM_Core_BAO_SchemaHandler::addIndexSignature($table, $indices); $extSigs[] = CRM_Utils_Array::collect('sig', $indices); @@ -747,10 +749,12 @@ MODIFY {$columnName} varchar( $length ) $missingIndices = array(); foreach ($missingSigs as $sig) { $sigParts = explode('::', $sig); - foreach ($requiredIndices[$sigParts[0]] as $index) { - if ($index['sig'] == $sig) { - $missingIndices[$sigParts[0]][] = $index; - continue; + if (array_key_exists($sigParts[0], $requiredIndices)) { + foreach ($requiredIndices[$sigParts[0]] as $index) { + if ($index['sig'] == $sig) { + $missingIndices[$sigParts[0]][] = $index; + continue; + } } } }