Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CRM-19051 improve respect for the offline trigger setting. #9602

Merged
merged 1 commit into from
Mar 16, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CRM/Admin/Form/Setting/Localization.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)")
Expand Down
18 changes: 8 additions & 10 deletions CRM/Core/BAO/Log.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@
/**
*
* @package CRM
* @copyright CiviCRM LLC (c) 2004-2017
* $Id$
*
* @copyright CiviCRM LLC (c) 2004-2016
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The joy of late merges :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

argh - well spotted!

*/

/**
Expand Down Expand Up @@ -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;
}

Expand Down
5 changes: 4 additions & 1 deletion CRM/Core/DAO.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down