From 63809327ddc42576d21eef8ddb1ecb080bb83f7a Mon Sep 17 00:00:00 2001 From: eileen Date: Sun, 16 Apr 2017 16:55:06 +1200 Subject: [PATCH] CRM-20312 add a little more detail as to how to update indexes --- CRM/Utils/Check/Component/Schema.php | 10 ++-------- tests/phpunit/CRM/Core/BAO/SchemaHandlerTest.php | 15 +++++++++------ 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/CRM/Utils/Check/Component/Schema.php b/CRM/Utils/Check/Component/Schema.php index 75c20a6b5d..07c05e1cb7 100644 --- a/CRM/Utils/Check/Component/Schema.php +++ b/CRM/Utils/Check/Component/Schema.php @@ -41,14 +41,8 @@ class CRM_Utils_Check_Component_Schema extends CRM_Utils_Check_Component { if ($missingIndices) { $messages[] = new CRM_Utils_Check_Message( __FUNCTION__, - ts('You have missing indices on some tables. This may cause poor performance. Please run ...' - // May want to reference blog post on this ... - // array( - // 1 => 'https://civicrm.org/blog/totten/psa-please-verify-php-extension-mysqli', - // 2 => 'mysqli', - // ) - ), - ts('Performance warning: Rebuild indices'), + ts('You have missing indices on some tables. This may cause poor performance. Please run System.updateindexes from the api explorer'), + ts('Performance warning: Missing indices'), \Psr\Log\LogLevel::WARNING, 'fa-server' ); diff --git a/tests/phpunit/CRM/Core/BAO/SchemaHandlerTest.php b/tests/phpunit/CRM/Core/BAO/SchemaHandlerTest.php index 07c59814d7..b45efed734 100644 --- a/tests/phpunit/CRM/Core/BAO/SchemaHandlerTest.php +++ b/tests/phpunit/CRM/Core/BAO/SchemaHandlerTest.php @@ -231,12 +231,15 @@ class CRM_Core_BAO_SchemaHandlerTest extends CiviUnitTestCase { public function testReconcileMissingIndices() { CRM_Core_DAO::executeQuery('ALTER TABLE civicrm_contact DROP INDEX index_sort_name'); $missingIndices = CRM_Core_BAO_SchemaHandler::getMissingIndices(); - $this->assertEquals(array('civicrm_contact' => array(array( - 'name' => 'index_sort_name', - 'field' => array('sort_name'), - 'localizable' => FALSE, - 'sig' => 'civicrm_contact::0::sort_name', - ))), $missingIndices); + $this->assertEquals(array( + 'civicrm_contact' => array( + array( + 'name' => 'index_sort_name', + 'field' => array('sort_name'), + 'localizable' => FALSE, + 'sig' => 'civicrm_contact::0::sort_name', + ), + )), $missingIndices); $this->callAPISuccess('System', 'updateindexes', array()); $missingIndices = CRM_Core_BAO_SchemaHandler::getMissingIndices(); $this->assertTrue(empty($missingIndices)); -- 2.25.1