Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mailgroup
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
mailgroup
Merge requests
!12
Issue
#3292085
: Mail Group Type can be deleted while still in use
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Issue
#3292085
: Mail Group Type can be deleted while still in use
issue/mailgroup-3292085:3292085-mail-group-type
into
2.1.x
Overview
0
Commits
1
Pipelines
0
Changes
1
Merged
davisben
requested to merge
issue/mailgroup-3292085:3292085-mail-group-type
into
2.1.x
2 years ago
Overview
0
Commits
1
Pipelines
0
Changes
1
Expand
0
0
Merge request reports
Compare
2.1.x
2.1.x (base)
and
latest version
latest version
05882de8
1 commit,
2 years ago
1 file
+
31
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
src/Entity/Form/MailGroupTypeDeleteForm.php
+
31
−
0
Options
@@ -32,6 +32,37 @@ class MailGroupTypeDeleteForm extends EntityConfirmFormBase {
return
$this
->
t
(
'Delete'
);
}
/**
* {@inheritdoc}
*/
public
function
buildForm
(
array
$form
,
FormStateInterface
$form_state
)
{
$count
=
$this
->
entityTypeManager
->
getStorage
(
'mailgroup'
)
->
getQuery
()
->
accessCheck
(
FALSE
)
->
condition
(
'type'
,
$this
->
entity
->
id
())
->
count
()
->
execute
();
if
(
$count
)
{
$message
=
$this
->
formatPlural
(
$count
,
'There is 1 group of the type %type. You can not remove this group type until you have removed all of the %type groups.'
,
'There are @count groups of the type %type. You can not remove this group type until you have removed all of the %type groups.'
,
[
'%type'
=>
$this
->
entity
->
label
()]
);
$form
[
'#title'
]
=
$this
->
getQuestion
();
$form
[
'description'
]
=
[
'#markup'
=>
'<p>'
.
$message
.
'</p>'
,
];
return
$form
;
}
return
parent
::
buildForm
(
$form
,
$form_state
);
}
/**
* {@inheritdoc}
*/
Loading