0

I'm migrating a D7 module that creates entities from a CSV file. I'm able to test this in drush core-cli by using:

$event = \Drupal::entityTypeManager()->getStorage('node')->create(['title' => 'testy1', 'type' => 'event', 'field_section' => 3, 'body' => "event info goes here",  'field_refreshment_details' => 'doughnuts!']); 

I'm using this form as it uses the Drupal 8.7 Entity classes based on answers found here: Programmatically create nodes

Using the console, I'm able to see several deprecation warnings which I'm asking for clarification as to why they're appearing. First, because Drupal 9 is coming, my customer does not want to pay to rewrite this module only six months away. Researching the one that appeared the most I'm aware what it wants me to do, but since I'm creating an Entity using its classes, I'm not directly invoking ConfigurablePluginInterface that I can tell.

PHP Deprecated: Drupal/Component/Plugin/ConfigurablePluginInterface is deprecated in Drupal 8.7.0 and will be removed before Drupal 9.0.0. You should implement ConfigurableInterface and/or DependentPluginInterface directly as needed. If you implement ConfigurableInterface you may choose to implement ConfigurablePluginInterface in Drupal 8 as well for maximum compatibility, however this must be removed prior to Drupal 9. See https://www.drupal.org/node/2946161 in /media/psf/Home/apps/mydrupalapp/core/lib/Drupal/Component/Plugin/PluginBase.php on line 59

Is this a case of a dependency of a dependency I'm using is using this deprecated interface? How should I be instantiating my new Node entities that will survive the transition to Drupal 9?

  • Is this a case of a dependency of a dependency I'm using is using this deprecated interface? Indeed. How should I be instantiating my new Node entities that will survive the transition to Drupal 9? No different to how you're currently doing it - it's the code using the deprecated method that needs to change, not yours. If that's in core it'll have to change to pass the tests, if it's in contrib then slightly different story – Clive Jun 25 at 18:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.