diff --git a/core/lib/Drupal/Core/Field/FormatterPluginManager.php b/core/lib/Drupal/Core/Field/FormatterPluginManager.php index b39a822..d81ff57 100644 --- a/core/lib/Drupal/Core/Field/FormatterPluginManager.php +++ b/core/lib/Drupal/Core/Field/FormatterPluginManager.php @@ -95,8 +95,8 @@ public function createInstance($plugin_id, array $configuration = array()) { * - settings: (array) Settings specific to the formatter. Each setting * defaults to the default value specified in the formatter definition. * - * @return \Drupal\Core\Field\FormatterInterface|null - * A formatter object or NULL when plugin is not found. + * @return \Drupal\Core\Field\FormatterInterface + * A formatter object. */ public function getInstance(array $options) { $configuration = $options['configuration']; @@ -117,9 +117,6 @@ public function getInstance(array $options) { if (!isset($definition['class']) || !in_array($field_type, $definition['field_types'])) { // Grab the default widget for the field type. $field_type_definition = $this->fieldTypeManager->getDefinition($field_type); - if (empty($field_type_definition['default_formatter'])) { - return NULL; - } $plugin_id = $field_type_definition['default_formatter']; } diff --git a/core/lib/Drupal/Core/Field/WidgetPluginManager.php b/core/lib/Drupal/Core/Field/WidgetPluginManager.php index 366f010..47fedb1 100644 --- a/core/lib/Drupal/Core/Field/WidgetPluginManager.php +++ b/core/lib/Drupal/Core/Field/WidgetPluginManager.php @@ -75,8 +75,8 @@ public function __construct(\Traversable $namespaces, CacheBackendInterface $cac * - settings: (array) Settings specific to the widget. Each setting * defaults to the default value specified in the widget definition. * - * @return \Drupal\Core\Field\WidgetInterface|null - * A Widget object or NULL when plugin is not found. + * @return \Drupal\Core\Field\WidgetInterface + * A Widget object. */ public function getInstance(array $options) { // Fill in defaults for missing properties. @@ -103,9 +103,6 @@ public function getInstance(array $options) { if (!isset($definition['class']) || !in_array($field_type, $definition['field_types'])) { // Grab the default widget for the field type. $field_type_definition = $this->fieldTypeManager->getDefinition($field_type); - if (empty($field_type_definition['default_widget'])) { - return NULL; - } $plugin_id = $field_type_definition['default_widget']; }