You are here

function hook_farm_log_prepopulate_reference_fields_alter in farmOS 7

Allow modules to alter information about fields that should be prepopulated in log forms.

Parameters

array $fields: An array of field information defined via hook_farm_log_prepopulate_reference_fields().

string $log_type: The log type.

Return value

array Returns an array of field information.

Related topics

1 function implements hook_farm_log_prepopulate_reference_fields_alter()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

farm_livestock_farm_log_prepopulate_reference_fields_alter in modules/farm/farm_livestock/farm_livestock.module
Implements hook_farm_log_prepopulate_reference_fields_alter().
1 invocation of hook_farm_log_prepopulate_reference_fields_alter()
farm_log_prepopulate_log_form_references in modules/farm/farm_log/farm_log.module
Helper function for populating entity reference fields in log forms.

File

modules/farm/farm_log/farm_log.api.php, line 95
Hooks provided by farm_log.

Code

function hook_farm_log_prepopulate_reference_fields_alter(&$fields, $log_type) {

  // Example: don't allow prepopulating the asset field on activity logs.
  if ($log_type == 'farm_activity') {
    unset($fields['field_farm_asset']);
  }
}