function SelectionPluginBase::ensureBackwardCompatibilityConfiguration

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

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;
    }
  }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.