Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
required_api
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
required_api
Commits
0439f6db
Commit
0439f6db
authored
2 months ago
by
Dieter Holvoet
Browse files
Options
Downloads
Patches
Plain Diff
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
2 months ago
Stage: build
Stage: validate
Stage: test
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
required_api.module
+0
-1
0 additions, 1 deletion
required_api.module
src/Plugin/Required/RequiredBase.php
+3
-10
3 additions, 10 deletions
src/Plugin/Required/RequiredBase.php
src/Plugin/RequiredPluginInterface.php
+0
-11
0 additions, 11 deletions
src/Plugin/RequiredPluginInterface.php
with
3 additions
and
22 deletions
required_api.module
+
0
−
1
View file @
0439f6db
...
@@ -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'
];
}
}
/**
/**
...
...
This diff is collapsed.
Click to expand it.
src/Plugin/Required/RequiredBase.php
+
3
−
10
View file @
0439f6db
...
@@ -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
[];
...
...
This diff is collapsed.
Click to expand it.
src/Plugin/RequiredPluginInterface.php
+
0
−
11
View file @
0439f6db
...
@@ -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
;
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment