Problem/Motivation

\Drupal\Core\Field\Plugin\PluginSettingsInterface is an old interface that is used to manage configuration/settings on field API plugins. It has since been superseded by ConfigurablePluginInterface and no plugins outside field API use PluginSettingsInterface. #1764380: Merge PluginSettingsInterface into ConfigurableInterface aimed to remove the interface, but we are too late in Drupal 8's release cycle for that now.

Proposed resolution

Deprecate PluginSettingsInterface and advise people to use ConfigurablePluginInterface instead.

Remaining tasks

None.

User interface changes

None.

API changes

None.

Comments

xano’s picture

Status: Active » Needs review
StatusFileSize
new580 bytes

Status: Needs review » Needs work

The last submitted patch, 1: drupal_2502967_1.patch, failed testing.

Status: Needs work » Needs review

Xano queued 1: drupal_2502967_1.patch for re-testing.

berdir’s picture

Are we sure that this really makes sense?

This is a field specific interface and various plugins there very much use it.

I'm not sure what impact this has in PhpStorm for example, are methods that are defined by this interface marked as deprecated?

That would definitely be wrong...

tim.plunkett’s picture

Hopefully the Drupal\Core\Field namespace will discourage people from using it, and stick to stuff in Drupal\Component\Plugin

berdir’s picture

Yeah...

I'd rather just explicitly document that this interface is specific to the field subsystem and other plugin types should use ConfigurablePluginInterface, without adding @deprecated or so.

mile23’s picture

Status: Needs review » Needs work
Issue tags: +@deprecated

So is this a case of changed scope?

mile23’s picture

Title: Deprecate PluginSettingsInterface » Mark PluginSettingsInterface as deprecated for removal before Drupal 9.0.x
Version: 8.0.x-dev » 8.1.x-dev
Issue tags: +Needs reroll
alvar0hurtad0’s picture

Assigned: Unassigned » alvar0hurtad0

Working on this

alvar0hurtad0’s picture

Assigned: alvar0hurtad0 » Unassigned
Status: Needs work » Needs review
StatusFileSize
new608 bytes

reroll

andypost’s picture

Status: Needs review » Needs work
+++ b/core/lib/Drupal/Core/Field/PluginSettingsInterface.php
@@ -12,6 +12,9 @@
+ * @deprecated Deprecated as of 8.0.0. Scheduled for removal in 9.0.0. Use

8.1.0

uzlov’s picture

StatusFileSize
new610 bytes

changed to 8.1.0

uzlov’s picture

Status: Needs work » Needs review
uzlov’s picture

Issue tags: -Needs reroll
berdir’s picture

Status: Needs review » Reviewed & tested by the community

Makes sense. We don't want contrib to pick this up, they should use the other interface.

I applied this to try and make sure that it doesn't mark the interfaces/classes that implement this as deprecated. Works correctly.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed fea9559 and pushed to 8.1.x. Thanks!

diff --git a/core/lib/Drupal/Core/Field/PluginSettingsInterface.php b/core/lib/Drupal/Core/Field/PluginSettingsInterface.php
index 5b40aaa..7297338 100644
--- a/core/lib/Drupal/Core/Field/PluginSettingsInterface.php
+++ b/core/lib/Drupal/Core/Field/PluginSettingsInterface.php
@@ -13,8 +13,8 @@
 /**
  * Interface definition for plugin with settings.
  *
- * @deprecated Deprecated as of 8.1.0. Scheduled for removal in 9.0.0. Use
- *   \Drupal\Component\Plugin\ConfigurablePluginInterface instead. *
+ * @deprecated in Drupal 8.1.0 and will be removed before Drupal 9.0.0. Use
+ *   \Drupal\Component\Plugin\ConfigurablePluginInterface instead.
  */
 interface PluginSettingsInterface extends PluginInspectionInterface, ThirdPartySettingsInterface {
 

I removed the trailing * on the second line and formatted the comment to fit the standard in core.

  • alexpott committed fea9559 on 8.1.x
    Issue #2502967 by uzlov, Xano, alvar0hurtad0: Mark...

Status: Fixed » Closed (fixed)

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

claudiu.cristea’s picture

Hm. But what about PluginSettingsInterface::onDependencyRemoval()? As developer I'm advised to use ConfigurablePluginInterface but that doesn't have onDependencyRemoval().