Skip to content
Snippets Groups Projects
Commit 0439f6db authored by Dieter Holvoet's avatar Dieter Holvoet
Browse files

Revert "Issue #3491931 by dieterholvoet: Allow plugins to alter config form values"

This reverts commit 1bab00e3.
parent 1bab00e3
No related branches found
No related tags found
No related merge requests found
Pipeline #360252 failed
...@@ -86,7 +86,6 @@ function required_api_form_field_config_edit_form_alter(array &$form, FormStateI ...@@ -86,7 +86,6 @@ function required_api_form_field_config_edit_form_alter(array &$form, FormStateI
$form['default_value'][$field_name]['widget'][0]['value']['#required'] = FALSE; $form['default_value'][$field_name]['widget'][0]['value']['#required'] = FALSE;
} }
$form['actions']['submit']['#submit'][] = [$plugin, 'submitFieldConfigForm'];
} }
/** /**
......
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
namespace Drupal\required_api\Plugin\Required; namespace Drupal\required_api\Plugin\Required;
use Drupal\Core\Field\FieldDefinitionInterface; use Drupal\Core\Field\FieldDefinitionInterface;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Plugin\PluginBase; use Drupal\Core\Plugin\PluginBase;
use Drupal\required_api\Plugin\RequiredPluginInterface; use Drupal\required_api\Plugin\RequiredPluginInterface;
use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\ContainerInterface;
...@@ -44,20 +43,14 @@ abstract class RequiredBase extends PluginBase implements RequiredPluginInterfac ...@@ -44,20 +43,14 @@ abstract class RequiredBase extends PluginBase implements RequiredPluginInterfac
} }
/** /**
* {@inheritdoc} * Required method to get the configuration.
*/
public function submitFieldConfigForm(array &$form, FormStateInterface $form_state): void {
}
/**
* {@inheritdoc}
*/ */
public function getConfiguration() { public function getConfiguration() {
return $this->configuration; return $this->configuration;
} }
/** /**
* {@inheritdoc} * Required method to set the configuration.
*/ */
public function setConfiguration(array $configuration) { public function setConfiguration(array $configuration) {
$this->configuration = $configuration; $this->configuration = $configuration;
...@@ -65,7 +58,7 @@ abstract class RequiredBase extends PluginBase implements RequiredPluginInterfac ...@@ -65,7 +58,7 @@ abstract class RequiredBase extends PluginBase implements RequiredPluginInterfac
} }
/** /**
* {@inheritdoc} * Required method to set the default configuration.
*/ */
public function defaultConfiguration() { public function defaultConfiguration() {
return []; return [];
......
...@@ -5,7 +5,6 @@ namespace Drupal\required_api\Plugin; ...@@ -5,7 +5,6 @@ namespace Drupal\required_api\Plugin;
use Drupal\Component\Plugin\ConfigurableInterface; use Drupal\Component\Plugin\ConfigurableInterface;
use Drupal\Component\Plugin\PluginInspectionInterface; use Drupal\Component\Plugin\PluginInspectionInterface;
use Drupal\Core\Field\FieldDefinitionInterface; use Drupal\Core\Field\FieldDefinitionInterface;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Plugin\ContainerFactoryPluginInterface; use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
use Drupal\Core\Session\AccountInterface; use Drupal\Core\Session\AccountInterface;
...@@ -38,14 +37,4 @@ interface RequiredPluginInterface extends PluginInspectionInterface, Configurabl ...@@ -38,14 +37,4 @@ interface RequiredPluginInterface extends PluginInspectionInterface, Configurabl
*/ */
public function requiredFormElement(FieldDefinitionInterface $field); public function requiredFormElement(FieldDefinitionInterface $field);
/**
* Optional submit handler for the field config form.
*
* @param array $form
* The form.
* @param \Drupal\Core\Form\FormStateInterface $form_state
* The form state.
*/
public function submitFieldConfigForm(array &$form, FormStateInterface $form_state): void;
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment