Wordpress unable to edit grant application
Created by: shawnholt
I had previously been able to edit a grant application in WP. Now trying the popup hangs. I see on the console an error: "Uncaught Cannot guess entity name for field_type=Grant" in wp-content/plugins/civicrm/civicrm/js/model/crm.uf.js I naively added a hack to the "hack" by adding: case 'Grant': return 'grant_1'; and now it seems to work Poor "Grant" entity, seems to be the abandoned stepchild :)
/**
* This function is a hack for generating simulated values of "entity_name"
* in the form-field model.
*
* @param {string} field_type
* @return {string}
*/
CRM.UF.guessEntityName = function(field_type) {
switch (field_type) {
case 'Contact':
case 'Individual':
case 'Organization':
case 'Household':
return 'contact_1';
case 'Activity':
return 'activity_1';
case 'Contribution':
return 'contribution_1';
case 'Membership':
return 'membership_1';
case 'Participant':
return 'participant_1';
case 'Case':
return 'case_1';
default:
if (!$.isEmptyObject(CRM.contactSubTypes) && ($.inArray(field_type,CRM.contactSubTypes) > -1)) {
return 'contact_1';
}
else {
throw "Cannot guess entity name for field_type=" + field_type;
}
}
};