Problem/Motivation

#2821191: Allow object-based plugin definitions to be processed in PluginDependencyTrait added a new interface and trait to Drupal\Component
Yet it corresponds to a concept that is firmly in the domain of \Drupal\Core\Config\Entity\ConfigDependencyManager

However!
\Drupal\Component\Plugin\DependentPluginInterface already incorrectly exists here, and has since late 2014: #2271419: Allow field types, widgets, formatters to specify config dependencies

It would seem to make sense to also move that interface, or copy and deprecate it.

However!
In that same issue, \Drupal\Component\Plugin\ConfigurablePluginInterface was made to extend DependentPluginInterface (which was a questionable decision on its own).

So this only moves the newly added interface/trait, and leaves the other equally confusing ones as-is

Proposed resolution

Move DependentPluginDefinitionInterface and DependentPluginDefinitionTrait to Drupal\Core

Remaining tasks

N/A

User interface changes

N/A

API changes

BC break but only within the alpha

Data model changes

N/A

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

tim.plunkett created an issue. See original summary.

tim.plunkett’s picture

Status: Active » Needs review
FileSize
3.9 KB
tim.plunkett’s picture

Note that this interface was added to core less than 48 hours ago, and has not been in a release yet.

mpdonadio’s picture

Status: Needs review » Reviewed & tested by the community

Reading this in context, it doesn't really make any sense why these are in \Component. The usages are all in \Core, and the comments reflect code in \Core. So, these don't seem to be able to stand on their own, which is the whole point of having \Component (ie, things that don't have true Drupal dependencies that the project needs).

  • xjm committed 1e77f5d on 8.3.x
    Issue #2851574 by tim.plunkett, mpdonadio:...
xjm’s picture

Version: 8.4.x-dev » 8.3.x-dev
Status: Reviewed & tested by the community » Fixed

Yeah agreed; these don't need to be in \Component. Since these were only added 36h ago, fixing them pronto and not tying ourselves to BC with a wrong code location forever is a good thing.

I read the names of \Drupal\Component\Plugin\ConfigurablePluginInterface (in HEAD since 2014, stable, not moving) and Drupal\Component\Plugin\Definition\DependentPluginDefinitionInterface (added within the past two days in #2821191: Allow object-based plugin definitions to be processed in PluginDependencyTrait) many, many times. They are not the same.

I asked @tim.plunkett what CR to update and he said he's still writing it. ;) It technically should have been written before prior commits, but since this issue is only a namespace fix for one small part of said commits, and this issue will prevent aforementioned BC-to-wrong-code-location, it doesn't make any sense to require that for this issue.

Committed to the thing, and the other thing.

Status: Fixed » Closed (fixed)

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