Skip to content

Commit

Permalink
dev/core#1812
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephen Palmstrom committed Jul 13, 2020
1 parent 64aa560 commit a99a669
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CRM/Admin/Form/Setting/Miscellaneous.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ public function buildQuickForm() {
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);

Expand Down
4 changes: 4 additions & 0 deletions CRM/Logging/Schema.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ public static function checkLoggingSupport(&$value, $fieldSpec) {
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;
}

Expand Down
8 changes: 6 additions & 2 deletions templates/CRM/Admin/Form/Setting/Miscellaneous.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,14 @@
<td>
{$form.logging.html}<br />
{if $validTriggerPermission}
<p class="description">{ts}If enabled, all actions will be logged with a complete record of changes.{/ts}</p>
{if $isMultilingual}
<p class="description">{ts}Logging is not supported in multilingual environments.{/ts}</p>
{else}
<p class="description">{ts}If enabled, all actions will be logged with a complete record of changes.{/ts}</p>
{/if}
{else}
<p class="description">{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}&nbsp;{ts}This functionality cannot be enabled on multilingual installations.{/ts}</p>
{/if}
{/if}
</td>
</tr>
<tr class="crm-miscellaneous-form-block-doNotAttachPDFReceipt">
Expand Down

0 comments on commit a99a669

Please sign in to comment.