The following error appear while updating the core to Drupal 8.3.0-dev

Fatal error: Class Drupal\plugin\PluginDefinition\ArrayPluginDefinitionDecorator contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (Drupal\Component\Plugin\Definition\PluginDefinitionInterface::id) in /..../modules/contrib/plugin/src/PluginDefinition/ArrayPluginDefinitionDecorator.php on line 367

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Londova created an issue. See original summary.

Berdir’s picture

Not sure why the core issue went with id() instead of getId() but this should fix it, lets see if something else is broken too.

Status: Needs review » Needs work

The last submitted patch, 2: plugin-id-2851503-2.patch, failed testing.

Berdir’s picture

Status: Needs work » Needs review
FileSize
2.37 KB

Core doesn't find classes directly in tests/src anymore, moved to Unit, it's only used there. Actually it is more common that those are directly in the test class file that needs it, but maybe more will need it at some point.

tim.plunkett’s picture

Status: Needs review » Reviewed & tested by the community

Between #2350807: add getId() and make id() a wrapper for it and deprecate it and #2246695: replace all core usages of id() with getid(), pretty sure Xano (or was it tstoeckler?) would want it the opposite direction.
But yes, this works too. RTBCing for now.

andypost’s picture

+++ b/src/PluginDefinition/PluginDefinitionInterface.php
@@ -26,6 +26,8 @@ interface PluginDefinitionInterface extends ComponentPluginDefinitionInterface {
+   * @deprecated Use ::id() instead.

missing in and when will be removed

Berdir’s picture

Well yes, this is contrib, so I have no idea when it will be removed. 9.x-1.0? 8.x-3.0? Maybe before that we'll have semantic versions in contrib? Or maybe the referenced core issue will get in, which will turn this whole thing upside down anyway.

Honestly don't think we need to be so strict in contrib, maybe we should simply not deprecate anything yet, as we don't really know if id() or getId() will remain in the end.

Berdir’s picture

Here's a version without the @deprecated.

tim.plunkett’s picture

+1, I think this is entirely reasonable to commit as-is, and leave the debate to another issue.

  • Berdir committed b525f0d on 8.x-2.x
    Issue #2851503 by Berdir: Drupal\plugin\PluginDefinition\...
Berdir’s picture

Status: Reviewed & tested by the community » Fixed

Thanks, committed!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.