diff --git a/CRM/Admin/Form/Setting/Localization.php b/CRM/Admin/Form/Setting/Localization.php index bae910d9ffcd..8e2b2718ab23 100644 --- a/CRM/Admin/Form/Setting/Localization.php +++ b/CRM/Admin/Form/Setting/Localization.php @@ -88,7 +88,7 @@ public function buildQuickForm() { $validTriggerPermission = CRM_Core_DAO::checkTriggerViewPermission(TRUE); if ($validTriggerPermission && - !$config->logging + !\Civi::settings()->get('logging') ) { $this->addElement('checkbox', 'makeMultilingual', ts('Enable Multiple Languages'), NULL, array('onChange' => "if (this.checked) CRM.alert($warning, $warningTitle)") diff --git a/CRM/Core/BAO/Log.php b/CRM/Core/BAO/Log.php index f81d5ebc9c51..98765340101b 100644 --- a/CRM/Core/BAO/Log.php +++ b/CRM/Core/BAO/Log.php @@ -28,9 +28,7 @@ /** * * @package CRM - * @copyright CiviCRM LLC (c) 2004-2017 - * $Id$ - * + * @copyright CiviCRM LLC (c) 2004-2016 */ /** @@ -166,16 +164,16 @@ public static function getContactLogCount($contactID) { } /** - * Function for find out whether to use logging schema entries for contact. - * summary, instead of normal log entries. + * Get the id of the report to use to display the change log. * - * @return int - * report id of Contact Logging Report (Summary) / false + * If logging is not enabled a return value of FALSE means to use the + * basic change log view. + * + * @return int|FALSE + * report id of Contact Logging Report (Summary) */ public static function useLoggingReport() { - // first check if logging is enabled - $config = CRM_Core_Config::singleton(); - if (!$config->logging) { + if (!\Civi::settings()->get('logging')) { return FALSE; } diff --git a/CRM/Core/DAO.php b/CRM/Core/DAO.php index 2c4d8992b7a1..48245dd445d3 100644 --- a/CRM/Core/DAO.php +++ b/CRM/Core/DAO.php @@ -1910,10 +1910,13 @@ public static function createTempTableName($prefix = 'civicrm', $addRandomString * @return bool */ public static function checkTriggerViewPermission($view = TRUE, $trigger = TRUE) { + if (\Civi::settings()->get('logging_no_trigger_permission')) { + return TRUE; + } // test for create view and trigger permissions and if allowed, add the option to go multilingual // and logging // I'm not sure why we use the getStaticProperty for an error, rather than checking for DB_Error - $errorScope = CRM_Core_TemporaryErrorScope::ignoreException(); + CRM_Core_TemporaryErrorScope::ignoreException(); $dao = new CRM_Core_DAO(); if ($view) { $result = $dao->query('CREATE OR REPLACE VIEW civicrm_domain_view AS SELECT * FROM civicrm_domain');