3
0
Fork 0
mirror of https://github.com/farmOS/farmOS.git synced 2024-02-23 11:37:38 +01:00

Don't add fields or filters for "hidden" bundle fields.

This commit is contained in:
paul121 2021-04-26 13:29:56 -07:00 committed by Michael Stenta
parent 9ce8e65617
commit 05cbfdc34f

View file

@ -149,6 +149,12 @@ function farm_ui_views_add_bundle_handlers(ViewExecutable $view, string $display
$bundle_fields = \Drupal::entityTypeManager()->getHandler($base_entity->id(), 'bundle_plugin')->getFieldDefinitions($bundle);
foreach (array_reverse($bundle_fields) as $field_name => $field_definition) {
// Skip the bundle field if the view display was set as "hidden".
$view_options = $field_definition->getDisplayOptions('view');
if (empty($view_options) || $view_options['region'] == 'hidden') {
continue;
}
// Save the field type.
$field_type = $field_definition->getType();