X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=js%2Fjquery%2Fjquery.crmProfileSelector.js;h=83d1cfcf3a25249ca3c0a562512c354656e33f5f;hb=83ed3076a4bcb069221056f44ea26590f5c7e8f9;hp=bb09f4335139770429cc6f2bc9daf0945cefc23c;hpb=6b5c23de751e6db560b26f775ff83e1a4b2bee2b;p=civicrm-core.git diff --git a/js/jquery/jquery.crmProfileSelector.js b/js/jquery/jquery.crmProfileSelector.js index bb09f43351..83d1cfcf3a 100644 --- a/js/jquery/jquery.crmProfileSelector.js +++ b/js/jquery/jquery.crmProfileSelector.js @@ -34,7 +34,7 @@ matchingUfGroups = ufGroupCollection.subcollection({ filter: function(ufGroupModel) { //CRM-16915 - filter with module used by the profile - if (!$.isEmptyObject(options.usedByFilter)) { + if (options.usedByFilter && options.usedByFilter.length) { usedByFilter = options.usedByFilter; } return ufGroupModel.checkGroupType(options.groupTypeFilter, options.allowAllSubtypes, usedByFilter); @@ -45,7 +45,7 @@ } //CRM-15427 check for valid subtypes raise a warning if not valid - if (options.allowAllSubtypes && $.isEmptyObject(validTypesId)) { + if (options.allowAllSubtypes && !validTypesId.length) { validTypes = ufGroupCollection.subcollection({ filter: function(ufGroupModel) { return ufGroupModel.checkGroupType(options.groupTypeFilter); @@ -55,7 +55,7 @@ validTypesId.push(validTypesattr.id); }); } - if (!$.isEmptyObject(validTypesId) && $.inArray($select.val(), validTypesId) == -1) { + if (validTypesId.length && $.inArray($select.val(), validTypesId) == -1) { var civiComponent; if (options.groupTypeFilter.indexOf('Membership') !== -1) { civiComponent = 'Membership';