Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
rabbit_hole-3213798
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
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
Issue forks
rabbit_hole-3213798
Commits
acd13be8
Commit
acd13be8
authored
8 years ago
by
git
Committed by
Dylan Donkersgoed
8 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#2744329
by phillipHG, ieguskiza: Rabbit Hole form appears on a node delete form
parent
50a24fe7
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
rabbit_hole.module
+4
-2
4 additions, 2 deletions
rabbit_hole.module
with
4 additions
and
2 deletions
rabbit_hole.module
+
4
−
2
View file @
acd13be8
...
...
@@ -58,9 +58,11 @@ function rabbit_hole_form_alter(&$form, FormStateInterface $form_state, $form_id
->
loadSupportedGlobalForms
();
if
(
method_exists
(
$form_state
->
getFormObject
(),
'getEntity'
))
{
$current_type
=
$form_state
->
getFormObject
()
->
getEntity
()
->
getEntityTypeId
();
$current_operation
=
$form_state
->
getFormObject
()
->
getOperation
();
$disallowed_operations
=
array
(
'delete'
,
'cancel'
);
$administer_permitted
=
\Drupal
::
currentUser
()
->
hasPermission
(
'rabbit hole administer '
.
$current_type
);
if
(
in_array
(
$current_type
,
$affected_types
)
&&
$administer_permitted
)
{
if
(
in_array
(
$current_type
,
$affected_types
)
&&
$administer_permitted
&&
!
in_array
(
$current_operation
,
$disallowed_operations
)
)
{
\Drupal
::
service
(
'rabbit_hole.form_mangler'
)
->
addRabbitHoleOptionsToEntityForm
(
$form
,
$form_state
->
getFormObject
()
->
getEntity
(),
$form_state
,
$form_id
);
...
...
@@ -69,7 +71,7 @@ function rabbit_hole_form_alter(&$form, FormStateInterface $form_state, $form_id
array
(
'_rabbit_hole_general_form_submit'
))
);
}
elseif
(
in_array
(
$current_type
,
$affected_bundle_types
))
{
elseif
(
in_array
(
$current_type
,
$affected_bundle_types
)
&&
!
in_array
(
$current_operation
,
$disallowed_operations
)
)
{
\Drupal
::
service
(
'rabbit_hole.form_mangler'
)
->
addRabbitHoleOptionsToEntityForm
(
$form
,
$form_state
->
getFormObject
()
->
getEntity
(),
$form_state
,
$form_id
);
$form_state
->
setSubmitHandlers
(
...
...
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