Commit f775e7e0 authored by git's avatar git Committed by slashrsm

Issue #2694339 by sanja_m, Berdir, CTaPByK: Handle...

Issue #2694339 by sanja_m, Berdir, CTaPByK: Handle hook_crm_core_activity_type_add_fields_alter() and hook_crm_core_activity_type_add_field_instances_alter()
parent 1f19ac6f
...@@ -31,49 +31,6 @@ function hook_crm_core_contact_merge_contacts(Drupal\crm_core_contact\Entity\Con ...@@ -31,49 +31,6 @@ function hook_crm_core_contact_merge_contacts(Drupal\crm_core_contact\Entity\Con
} }
/**
* Provides possibility to change default fields that will be added to the
* recently created bundle of activity.
*
* @param $fields
* Array with fields that are going to be added to the activity bundle.
* @param CRMActivityType $activity_type
* Bundle of activity entity that was recently created.
*
* @see field_create_field()
* @see _crm_core_activity_type_default_fields()
*/
function hook_crm_core_activity_type_add_fields_alter(&$fields, CRMActivityType $activity_type) {
// Prevent field_activity_date from creation.
foreach ($fields as $key => $field) {
if ($field['field_name'] == 'field_activity_date') {
unset($fields[$key]);
}
}
}
/**
* Provides possibility to change default field instances that will be added to
* the recently created bundle of activity.
*
* @param $instances
* Array with field instances that are going to be added to the activity
* bundle.
* @param CRMActivityType $activity_type
* Bundle of activity entity that was recently created.
*
* @see field_create_instance()
* @see _crm_core_activity_type_default_field_instances()
*/
function hook_crm_core_activity_type_add_field_instances_alter(&$instances, CRMActivityType $activity_type) {
// Prevent field_activity_date from adding to an activity bundle.
foreach ($instances as $key => $instance) {
if ($instance['field_name'] == 'field_activity_date') {
unset($instances[$key]);
}
}
}
/** /**
* @} End of "addtogroup hooks". * @} End of "addtogroup hooks".
*/ */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment