diff --git a/ext/oauth-client/Civi/Api4/OAuthProvider.php b/ext/oauth-client/Civi/Api4/OAuthProvider.php index 726248815f59..7ef1b7ea2d47 100644 --- a/ext/oauth-client/Civi/Api4/OAuthProvider.php +++ b/ext/oauth-client/Civi/Api4/OAuthProvider.php @@ -62,6 +62,9 @@ public static function getFields($checkPermissions = TRUE) { [ 'name' => 'contactTemplate', ], + [ + 'name' => 'mailSettingsTemplate', + ], ]; }); return $action->setCheckPermissions($checkPermissions); diff --git a/ext/search_kit/ang/crmSearchAdmin/crmSearchClause.component.js b/ext/search_kit/ang/crmSearchAdmin/crmSearchClause.component.js index de886f38eb34..558e4817b655 100644 --- a/ext/search_kit/ang/crmSearchAdmin/crmSearchClause.component.js +++ b/ext/search_kit/ang/crmSearchAdmin/crmSearchClause.component.js @@ -61,16 +61,21 @@ } } - this.getField = function(expr) { + // Gets the first arg of type "field" + function getFirstArgFromExpr(expr) { if (!(expr in meta)) { meta[expr] = _.findWhere(searchMeta.parseExpr(expr).args, {type: 'field'}); } - return meta[expr] && meta[expr].field; + return meta[expr] || {}; + } + + this.getField = function(expr) { + return getFirstArgFromExpr(expr).field; }; this.getOptionKey = function(expr) { - var field = ctrl.getField(expr) || {}; - return field.suffix ? field.suffix.slice(1) : 'id'; + var arg = getFirstArgFromExpr(expr); + return arg.suffix ? arg.suffix.slice(1) : 'id'; }; this.addGroup = function(op) {