You are here

protected function SelectionPluginBase::ensureBackwardCompatibilityConfiguration in Drupal 8

Ensures a backward compatibility level configuration.

@internal

@todo Remove this method call and its method in Drupal 9.

See also

https://www.drupal.org/project/drupal/issues/3069757

https://www.drupal.org/node/2870971

1 call to SelectionPluginBase::ensureBackwardCompatibilityConfiguration()
SelectionPluginBase::setConfiguration in core/lib/Drupal/Core/Entity/EntityReferenceSelection/SelectionPluginBase.php
Sets the configuration for this plugin instance.

File

core/lib/Drupal/Core/Entity/EntityReferenceSelection/SelectionPluginBase.php, line 158

Class

SelectionPluginBase
Provides a base class for configurable selection handlers.

Namespace

Drupal\Core\Entity\EntityReferenceSelection

Code

protected function ensureBackwardCompatibilityConfiguration() {
  $keys = [
    'handler',
    'target_type',
    'entity',
    'handler_settings',
  ];

  // Synchronize back 'handler_settings'.
  foreach ($this->configuration as $key => $value) {

    // Filter out keys that belong strictly to the root level.
    if (!in_array($key, $keys, TRUE)) {
      $this->configuration['handler_settings'][$key] = $value;
    }
  }
}