Skip to content

Commit

Permalink
Update hook_civicrm_fieldOptions to handle other contexts (#612)
Browse files Browse the repository at this point in the history
  • Loading branch information
colemanw authored Sep 13, 2024
1 parent 2a3ea23 commit fa453f6
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions volunteer.php
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,12 @@ function volunteer_civicrm_angularModules(&$angularModules) {
* @param $params
*/
function volunteer_civicrm_fieldOptions($entity, $field, &$options, $params) {
if ($entity == "UFJoin" && $field == "entity_table" && $params['context'] == "validate") {
$options[CRM_Volunteer_DAO_Project::getTableName()] = CRM_Volunteer_DAO_Project::getTableName();
if ($entity == 'UFJoin' && $field == 'entity_table') {
if ($params['context'] == 'validate') {
$options[CRM_Volunteer_DAO_Project::getTableName()] = CRM_Volunteer_DAO_Project::getTableName();
}
else {
$options[CRM_Volunteer_DAO_Project::getTableName()] = 'Project';
}
}
}

0 comments on commit fa453f6

Please sign in to comment.