From a99a66965e17bd464560ce4252eec54d90aced85 Mon Sep 17 00:00:00 2001 From: Stephen Palmstrom Date: Mon, 13 Jul 2020 17:14:05 +0100 Subject: [PATCH] dev/core#1812 --- CRM/Admin/Form/Setting/Miscellaneous.php | 2 ++ CRM/Logging/Schema.php | 4 ++++ templates/CRM/Admin/Form/Setting/Miscellaneous.tpl | 8 ++++++-- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/CRM/Admin/Form/Setting/Miscellaneous.php b/CRM/Admin/Form/Setting/Miscellaneous.php index bfc248663a..94fce1edaf 100644 --- a/CRM/Admin/Form/Setting/Miscellaneous.php +++ b/CRM/Admin/Form/Setting/Miscellaneous.php @@ -75,6 +75,8 @@ class CRM_Admin_Form_Setting_Miscellaneous extends CRM_Admin_Form_Setting { CRM_Utils_System::setTitle(ts('Misc (Undelete, PDFs, Limits, Logging, Captcha, etc.)')); $this->assign('validTriggerPermission', CRM_Core_DAO::checkTriggerViewPermission(FALSE)); + // dev/core#1812 Assign multilingual status. + $this->assign('isMultilingual', CRM_Core_I18n::isMultilingual()); $this->addFormRule(['CRM_Admin_Form_Setting_Miscellaneous', 'formRule'], $this); diff --git a/CRM/Logging/Schema.php b/CRM/Logging/Schema.php index 183af4100a..9c8823feb2 100644 --- a/CRM/Logging/Schema.php +++ b/CRM/Logging/Schema.php @@ -77,6 +77,10 @@ class CRM_Logging_Schema { if (!(CRM_Core_DAO::checkTriggerViewPermission(FALSE)) && $value) { throw new API_Exception(ts("In order to use this functionality, the installation's database user must have privileges to create triggers and views (if binary logging is enabled – this means the SUPER privilege). This install does not have the required privilege(s) enabled.")); } + // dev/core#1812 Disable logging in a multilingual environment. + if (CRM_Core_I18n::isMultilingual() && $value) { + throw new API_Exception(ts("Logging is not supported in a multilingual environment!")); + } return TRUE; } diff --git a/templates/CRM/Admin/Form/Setting/Miscellaneous.tpl b/templates/CRM/Admin/Form/Setting/Miscellaneous.tpl index 68ace19f26..00b453ce21 100644 --- a/templates/CRM/Admin/Form/Setting/Miscellaneous.tpl +++ b/templates/CRM/Admin/Form/Setting/Miscellaneous.tpl @@ -31,10 +31,14 @@ {$form.logging.html}
{if $validTriggerPermission} -

{ts}If enabled, all actions will be logged with a complete record of changes.{/ts}

+ {if $isMultilingual} +

{ts}Logging is not supported in multilingual environments.{/ts}

+ {else} +

{ts}If enabled, all actions will be logged with a complete record of changes.{/ts}

+ {/if} {else}

{ts}In order to use this functionality, the installation's database user must have privileges to create triggers (in MySQL 5.0 – and in MySQL 5.1 if binary logging is enabled – this means the SUPER privilege). This install either does not seem to have the required privilege enabled.{/ts} {ts}This functionality cannot be enabled on multilingual installations.{/ts}

- {/if} + {/if} -- 2.25.1