diff --git a/modules/ui/map/farm_ui_map.module b/modules/ui/map/farm_ui_map.module index 9009f675..3879d55a 100644 --- a/modules/ui/map/farm_ui_map.module +++ b/modules/ui/map/farm_ui_map.module @@ -57,6 +57,15 @@ function farm_ui_map_asset_view(array &$build, EntityInterface $entity, EntityVi return $build; } + // The default view mode is used if a map_popup view mode is not provided. + // Alter the default view mode to only include common fields. + if ($display->getMode() === 'default') { + $common_fields = ['flag', 'group', 'id_tag', 'location', 'notes', 'parent', 'status']; + $build = array_filter($build, function ($key) use ($common_fields) { + return strpos($key, '#') === 0 || in_array($key, $common_fields); + }, ARRAY_FILTER_USE_KEY); + } + // Build link to view logs referencing the asset. $url = Url::fromRoute('view.farm_log.page_asset', ['asset' => $entity->id(), 'log_type' => 'all']); $build['logs_links'] = [