Contacts -> New Email give Unknown Error in Smarty when Allow Mail to be sent from logged in contact's email address disabled
I raised this issue in StackExchange some time ago, but didn't get a response. I was able to reproduce it in one of the demo sites: https://civicrm.demo.civihosting.com/civicrm/activity/email/add?atype=3&action=add&reset=1&context=standalone. Basically, if you disable Allow Mail to be sent from logged in user, you see the error. It will probably arise from any disabled Boolean setting as it is generated when a request for a setting value returns FALSE. The 'offending' line is 54 in …/CRM/Core/Smarty/plugins/function.crmSetting.php. Lines 52-57 read:
$result = civicrm_api('setting', 'getvalue', $params);
unset($errorScope);
if ($result === FALSE) {
$smarty->trigger_error("Unknown error");
return NULL;
}
So, any setting returning FALSE will trigger the error. Replacing line 54 with
if ($result === null)
cures the issue, but what other effects does it have?
I am running CiviCRM 5.9.1 under Joomla.