/** * {@inheritdoc} */ public function calculateDependencies() { $this->addDependencies(parent::calculateDependencies()); $definition = $this->formatterPluginManager->getDefinition($this->getDerivativeId()); $this->addDependency('module', $definition['provider']); // @todo Investigate why this does not work currently. //$this->calculatePluginDependencies($this->getFieldFormatter()); return $this->dependencies; }
/** * {@inheritdoc} */ public function calculateDependencies() { $dependencies = parent::calculateDependencies(); // Add the module providing the configured field storage as a dependency. if (($field_storage_definition = $this->getFieldStorageDefinition()) && $field_storage_definition instanceof EntityInterface) { $dependencies['config'][] = $field_storage_definition->getConfigDependencyName(); } // Add the module providing the formatter. if (!empty($this->options['type'])) { $dependencies['module'][] = $this->formatterPluginManager->getDefinition($this->options['type'])['provider']; } return $dependencies; }