Commit 8f9be788 authored by Gabe Sullice's avatar Gabe Sullice
Browse files

Issue #2980593 by Wim Leers, gabesullice: Follow-up for #2977879: remove work-around for #2977882

parent ee38db4b
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -60,13 +60,11 @@ function jsonapi_entity_base_field_info(EntityTypeInterface $entity_type) {

/**
 * Implements hook_entity_base_field_info().
 *
 * @todo Remove when https://www.drupal.org/project/drupal/issues/2977882 lands.
 */
function jsonapi_entity_bundle_field_info(EntityTypeInterface $entity_type, $bundle, array $base_field_definitions) {
  $fields = [];

  if ($entity_type->id() == 'taxonomy_term') {
  if (floatval(\Drupal::VERSION) < 8.6 && $entity_type->id() == 'taxonomy_term') {
    // Only terms in the same bundle can be a parent.
    $fields['parent'] = clone $base_field_definitions['parent'];
    $fields['parent']->setSetting('handler_settings', ['target_bundles' => [$bundle]]);