Skip to content
Snippets Groups Projects

Issue #3352640: Provide diff tokens for nodes

All threads resolved!
Open Patrick Fey requested to merge issue/diff-3352640:3352640-provide-diff-tokens into 2.x
All threads resolved!
Files
6
+ 5
8
@@ -6,7 +6,6 @@ namespace Drupal\diff;
use Drupal\Core\Cache\CacheBackendInterface;
use Drupal\Core\Config\ConfigFactoryInterface;
use Drupal\Core\Config\ImmutableConfig;
use Drupal\Core\Entity\EntityTypeManagerInterface;
use Drupal\Core\Extension\ModuleHandlerInterface;
use Drupal\Core\Plugin\DefaultPluginManager;
@@ -18,9 +17,6 @@ use Drupal\diff\Attribute\DiffLayoutBuilder as DiffLayoutBuilderAttribute;
*/
class DiffLayoutManager extends DefaultPluginManager {
protected ImmutableConfig $config;
protected ImmutableConfig $layoutPluginsConfig;
/**
* Constructs a DiffLayoutManager object.
*/
@@ -29,14 +25,12 @@ class DiffLayoutManager extends DefaultPluginManager {
CacheBackendInterface $cache_backend,
ModuleHandlerInterface $module_handler,
protected EntityTypeManagerInterface $entityTypeManager,
ConfigFactoryInterface $config_factory,
protected ConfigFactoryInterface $configFactory,
) {
parent::__construct('Plugin/diff/Layout', $namespaces, $module_handler, DiffLayoutInterface::class, DiffLayoutBuilderAttribute::class, DiffLayoutBuilderAnnotation::class);
$this->setCacheBackend($cache_backend, 'diff_layout_builder_plugins');
$this->alterInfo('diff_layout_builder_info');
$this->config = $config_factory->get('diff.settings');
+6
$this->layoutPluginsConfig = $config_factory->get('diff.layout_plugins');
}
/**
@@ -49,7 +43,10 @@ class DiffLayoutManager extends DefaultPluginManager {
* The layout plugin options.
*/
public function getPluginOptions(): array {
$plugins = $this->config->get('general_settings.layout_plugins');
$plugins = $this
->configFactory
->get('diff.settings')
->get('general_settings.layout_plugins');
$plugin_options = [];
// Get the plugins sorted and build an array keyed by the plugin id.
if ($plugins) {
Loading