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

Set the views_data handler to use contrib EntityViewsData for all entities with bundle plugins.

This commit is contained in:
paul121 2020-12-17 15:20:11 -08:00 committed by Michael Stenta
parent ee6e485525
commit 72139c7b67

View file

@ -6,6 +6,7 @@
*/
use Drupal\Core\Entity\EntityTypeInterface;
use Drupal\entity\EntityViewsData;
use Drupal\farm_entity\BundlePlugin\FarmEntityBundlePluginHandler;
/**
@ -35,6 +36,7 @@ function farm_entity_entity_type_build(array &$entity_types) {
if (!empty($entity_types[$entity_type])) {
$entity_types[$entity_type]->set('bundle_plugin_type', $entity_type . '_type');
$entity_types[$entity_type]->setHandlerClass('bundle_plugin', FarmEntityBundlePluginHandler::class);
$entity_types[$entity_type]->setHandlerClass('views_data', EntityViewsData::class);
}
}
}