- Issue created by @megachriz
In \Drupal\feeds\Plugin\Type\Target\FieldTargetBase
, there are three services not injected. These are:
\Drupal::entityQuery()
, which should be replaced with $this->entityTypeManager->getStorage()->getQuery() and the service 'entity_type.manager' should be injected.This will add three parameters to the constructor and because some Feeds plugins that extend FieldTargetBase call its parent constructor, the parameters should become optional.
Inject the three serviced mentioned above and add three optional parameters to the constructor. Also in the constructor, trigger an error with a deprecation warning if the three parameters are not set.
Write a change record about this change.
Code example:
if (!isset($entity_type_manager)) {
@trigger_error('Calling ' . __METHOD__ . '() without the $entity_type_manager argument is deprecated in feeds:3.0.0-rc1 and will be required in feeds:4.0.0. See https://www.drupal.org/node/xxx', E_USER_DEPRECATED);
$entity_type_manager = \Drupal::service('entity_type.manager');
}
'xxx' should be the node ID of the change record.
None.
\Drupal\feeds\Plugin\Type\Target\FieldTargetBase::__construct()
will get three optional additional parameters. An error with a deprecation warning is triggered when these are not set.
None.
Active
3.0
Code