Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
8af814f7
Commit
8af814f7
authored
Jan 16, 2017
by
Alex Pott
Browse files
Issue
#2843678
by Sam152: Remove dead code in hook_entity_bundle_field_info_alter
parent
38092ac0
Changes
2
Hide whitespace changes
Inline
Side-by-side
core/modules/content_moderation/content_moderation.module
View file @
8af814f7
...
...
@@ -72,15 +72,6 @@ function content_moderation_entity_operation(EntityInterface $entity) {
->
entityOperation
(
$entity
);
}
/**
* Sets required flag based on enabled state.
*/
function
content_moderation_entity_bundle_field_info_alter
(
&
$fields
,
EntityTypeInterface
$entity_type
,
$bundle
)
{
\
Drupal
::
service
(
'class_resolver'
)
->
getInstanceFromDefinition
(
EntityTypeInfo
::
class
)
->
entityBundleFieldInfoAlter
(
$fields
,
$entity_type
,
$bundle
);
}
/**
* Implements hook_entity_presave().
*/
...
...
core/modules/content_moderation/src/EntityTypeInfo.php
View file @
8af814f7
...
...
@@ -333,24 +333,6 @@ public function entityBaseFieldInfo(EntityTypeInterface $entity_type) {
return
$fields
;
}
/**
* Adds ModerationState constraint to bundles whose entities are moderated.
*
* @param \Drupal\Core\Field\FieldDefinitionInterface[] $fields
* The array of bundle field definitions.
* @param \Drupal\Core\Entity\EntityTypeInterface $entity_type
* The entity type definition.
* @param string $bundle
* The bundle.
*
* @see hook_entity_bundle_field_info_alter();
*/
public
function
entityBundleFieldInfoAlter
(
&
$fields
,
EntityTypeInterface
$entity_type
,
$bundle
)
{
if
(
!
empty
(
$fields
[
'moderation_state'
])
&&
$this
->
moderationInfo
->
shouldModerateEntitiesOfBundle
(
$entity_type
,
$bundle
))
{
$fields
[
'moderation_state'
]
->
addConstraint
(
'ModerationState'
,
[]);
}
}
/**
* Alters bundle forms to enforce revision handling.
*
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment