Commit 24f36dde authored by alexpott's avatar alexpott
Browse files

Issue #2003630 by ebeyrent, alexander.ilivanov: Replace drupal_container()...

Issue #2003630 by ebeyrent, alexander.ilivanov: Replace drupal_container() with Drupal::service() in the entity_reference() module.
parent d92b4e96
...@@ -86,7 +86,7 @@ function entity_reference_get_selection_handler($field, $instance, EntityInterfa ...@@ -86,7 +86,7 @@ function entity_reference_get_selection_handler($field, $instance, EntityInterfa
'instance' => $instance, 'instance' => $instance,
'entity' => $entity, 'entity' => $entity,
); );
return drupal_container()->get('plugin.manager.entity_reference.selection')->getInstance($options); return Drupal::service('plugin.manager.entity_reference.selection')->getInstance($options);
} }
/** /**
...@@ -234,10 +234,10 @@ function entity_reference_field_instance_settings_form($field, $instance, $form_ ...@@ -234,10 +234,10 @@ function entity_reference_field_instance_settings_form($field, $instance, $form_
$settings += array('handler' => 'default'); $settings += array('handler' => 'default');
// Get all selection plugins for this entity type. // Get all selection plugins for this entity type.
$selection_plugins = drupal_container()->get('plugin.manager.entity_reference.selection')->getSelectionGroups($field['settings']['target_type']); $selection_plugins = Drupal::service('plugin.manager.entity_reference.selection')->getSelectionGroups($field['settings']['target_type']);
$handler_groups = array_keys($selection_plugins); $handler_groups = array_keys($selection_plugins);
$handlers = drupal_container()->get('plugin.manager.entity_reference.selection')->getDefinitions(); $handlers = Drupal::service('plugin.manager.entity_reference.selection')->getDefinitions();
$handlers_options = array(); $handlers_options = array();
foreach ($handlers as $plugin_id => $plugin) { foreach ($handlers as $plugin_id => $plugin) {
// We only display base plugins (e.g. 'base', 'views', ..) and not entity // We only display base plugins (e.g. 'base', 'views', ..) and not entity
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment