Skip to content

Commit

Permalink
Fix fatal error in field handler.
Browse files Browse the repository at this point in the history
- Closes #216
  • Loading branch information
jhedstrom committed Dec 31, 2019
1 parent cf571eb commit fb77955
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Drupal/Driver/Fields/Drupal8/AbstractHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ public function __construct(\stdClass $entity, $entity_type, $field_name) {
// The bundle may be stored either under "step_bundle" or under the name
// of the entity's bundle key. If both are empty, assume this is a single
// bundle entity, and therefore make the bundle name the entity type.
$bundle_key = $entity_manager->getDefinition($entity_type)->getKey('bundle');
$bundle_key = \Drupal::entityTypeManager()->getDefinition($entity_type)->getKey('bundle');
$bundle = !empty($entity->$bundle_key) ? $entity->$bundle_key : (isset($entity->step_bundle) ? $entity->step_bundle : $entity_type);

$fields = $entity_manager->getFieldDefinitions($entity_type, $bundle);
$fields = $entity_field_manager->getFieldDefinitions($entity_type, $bundle);
$fieldsstring = '';
foreach ($fields as $key => $value) {
$fieldsstring = $fieldsstring . ", " . $key;
Expand Down

0 comments on commit fb77955

Please sign in to comment.