}
if ($missingIndices || $existingKeyIndices) {
$message = "You have missing indices on some tables. This may cause poor performance.";
- if ($keyMessage) {
+ if (!empty($keyMessage)) {
$message = $keyMessage;
}
$msg = new CRM_Utils_Check_Message(
* Check there are no missing indices
*/
public function testGetMissingIndices() {
- $missingIndices = CRM_Core_BAO_SchemaHandler::getMissingIndices();
+ list($missingIndices) = CRM_Core_BAO_SchemaHandler::getMissingIndices();
$this->assertTrue(empty($missingIndices));
}
*/
public function testReconcileMissingIndices() {
CRM_Core_DAO::executeQuery('ALTER TABLE civicrm_contact DROP INDEX index_sort_name');
- $missingIndices = CRM_Core_BAO_SchemaHandler::getMissingIndices();
+ list($missingIndices) = CRM_Core_BAO_SchemaHandler::getMissingIndices();
$this->assertEquals(array(
'civicrm_contact' => array(
array(
),
), $missingIndices);
$this->callAPISuccess('System', 'updateindexes', array());
- $missingIndices = CRM_Core_BAO_SchemaHandler::getMissingIndices();
+ list($missingIndices) = CRM_Core_BAO_SchemaHandler::getMissingIndices();
$this->assertTrue(empty($missingIndices));
}