Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal
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
drupal
Merge requests
!8771
Add new constraint that allows blank values during install
Code
Review changes
Check out branch
Download
Patches
Plain diff
Open
Add new constraint that allows blank values during install
issue/drupal-3461428:3461428-add-notblankafterinstall-constraint
into
11.x
Overview
0
Commits
10
Pipelines
11
Changes
6
Open
Alex Pott
requested to merge
issue/drupal-3461428:3461428-add-notblankafterinstall-constraint
into
11.x
11 months ago
Overview
0
Commits
10
Pipelines
11
Changes
6
Expand
Closes
#3461428
0
0
Merge request reports
Compare
11.x
version 10
11a913d8
1 month ago
version 9
5aaaa03b
1 month ago
version 8
3d0b2818
1 month ago
version 7
5c1a661b
2 months ago
version 6
bb03ed5c
2 months ago
version 5
b758496f
2 months ago
version 4
c7ac32f1
11 months ago
version 3
b6541c77
11 months ago
version 2
6645f61c
11 months ago
version 1
5ec03eb8
11 months ago
11.x (HEAD)
and
latest version
latest version
eeb26cc6
10 commits,
1 month ago
version 10
11a913d8
9 commits,
1 month ago
version 9
5aaaa03b
9 commits,
1 month ago
version 8
3d0b2818
8 commits,
1 month ago
version 7
5c1a661b
7 commits,
2 months ago
version 6
bb03ed5c
5 commits,
2 months ago
version 5
b758496f
4 commits,
2 months ago
version 4
c7ac32f1
4 commits,
11 months ago
version 3
b6541c77
3 commits,
11 months ago
version 2
6645f61c
2 commits,
11 months ago
version 1
5ec03eb8
1 commit,
11 months ago
6 files
+
132
−
21
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
6
Search (e.g. *.vue) (Ctrl+P)
core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/AfterInstallConstraint.php
0 → 100644
+
40
−
0
Options
<?php
namespace
Drupal\Core\Validation\Plugin\Validation\Constraint
;
use
Drupal\Core\StringTranslation\TranslatableMarkup
;
use
Drupal\Core\Validation\Attribute\Constraint
;
use
Symfony\Component\Validator\Constraints\Sequentially
;
/**
* AfterInstallConstraint constraint.
*
* Extends the Symfony All constraint to only validate after install.
*/
#
[
Constraint
(
id
:
'AfterInstall'
,
label
:
new
TranslatableMarkup
(
'After install composite constraint'
,
[],
[
'context'
=>
'Validation'
]),
type
:
FALSE
)]
class
AfterInstallConstraint
extends
Sequentially
{
/**
* {@inheritdoc}
*/
public
function
__construct
(
mixed
$constraints
=
NULL
,
?array
$groups
=
NULL
,
mixed
$payload
=
NULL
)
{
$constraint_manager
=
\Drupal
::
service
(
'validation.constraint'
);
// Instantiate constraint objects for array definitions.
$constraint_objects
=
[];
foreach
(
$constraints
as
$id
=>
$options
)
{
if
(
!
is_object
(
$options
))
{
$constraint_objects
[]
=
$constraint_manager
->
create
(
$id
,
$options
);
}
else
{
$constraint_objects
[]
=
$options
;
}
}
parent
::
__construct
(
$constraint_objects
,
$groups
,
$payload
);
}
}
Loading