summaryrefslogtreecommitdiffstats
path: root/core/modules/content_moderation/src/Entity
diff options
context:
space:
mode:
authorAlex Pott2017-01-17 14:07:19 (GMT)
committerAlex Pott2017-01-17 14:07:19 (GMT)
commit3bd9f365cf530b91d354baaf2895b6456be55d77 (patch)
tree35a4d7e89b7bdca97d16e1ff561fb3be8789f950 /core/modules/content_moderation/src/Entity
parentdc583b732afe4a4f5de2e18b7d4eba8d08e3a468 (diff)
Issue #2842040 by Alan-H, timmillwood: Remove unused code from Content Moderation handlers
Diffstat (limited to 'core/modules/content_moderation/src/Entity')
-rw-r--r--core/modules/content_moderation/src/Entity/Handler/ModerationHandler.php26
-rw-r--r--core/modules/content_moderation/src/Entity/Handler/ModerationHandlerInterface.php16
2 files changed, 0 insertions, 42 deletions
diff --git a/core/modules/content_moderation/src/Entity/Handler/ModerationHandler.php b/core/modules/content_moderation/src/Entity/Handler/ModerationHandler.php
index 9d89253..542cc84 100644
--- a/core/modules/content_moderation/src/Entity/Handler/ModerationHandler.php
+++ b/core/modules/content_moderation/src/Entity/Handler/ModerationHandler.php
@@ -2,7 +2,6 @@
namespace Drupal\content_moderation\Entity\Handler;
-use Drupal\Core\Config\Entity\ConfigEntityInterface;
use Drupal\Core\Entity\ContentEntityInterface;
use Drupal\Core\Entity\EntityHandlerInterface;
use Drupal\Core\Entity\EntityTypeInterface;
@@ -38,31 +37,6 @@ class ModerationHandler implements ModerationHandlerInterface, EntityHandlerInte
/**
* {@inheritdoc}
*/
- public function onBundleModerationConfigurationFormSubmit(ConfigEntityInterface $bundle) {
- // The Revisions portion of Entity API is not uniformly applied or
- // consistent. Until that's fixed, we'll make a best-attempt to apply it to
- // the common entity patterns so as to avoid every entity type needing to
- // implement this method, although some will still need to do so for now.
- // This is the API that should be universal, but isn't yet.
- // @see \Drupal\node\Entity\NodeType
- if (method_exists($bundle, 'setNewRevision')) {
- $bundle->setNewRevision(TRUE);
- }
- // This is the raw property used by NodeType, and likely others.
- elseif ($bundle->get('new_revision') !== NULL) {
- $bundle->set('new_revision', TRUE);
- }
- // This is the raw property used by BlockContentType, and maybe others.
- elseif ($bundle->get('revision') !== NULL) {
- $bundle->set('revision', TRUE);
- }
-
- $bundle->save();
- }
-
- /**
- * {@inheritdoc}
- */
public function enforceRevisionsEntityFormAlter(array &$form, FormStateInterface $form_state, $form_id) {
}
diff --git a/core/modules/content_moderation/src/Entity/Handler/ModerationHandlerInterface.php b/core/modules/content_moderation/src/Entity/Handler/ModerationHandlerInterface.php
index c3d6ddd..976fbb2 100644
--- a/core/modules/content_moderation/src/Entity/Handler/ModerationHandlerInterface.php
+++ b/core/modules/content_moderation/src/Entity/Handler/ModerationHandlerInterface.php
@@ -2,7 +2,6 @@
namespace Drupal\content_moderation\Entity\Handler;
-use Drupal\Core\Config\Entity\ConfigEntityInterface;
use Drupal\Core\Entity\ContentEntityInterface;
use Drupal\Core\Form\FormStateInterface;
@@ -28,21 +27,6 @@ interface ModerationHandlerInterface {
public function onPresave(ContentEntityInterface $entity, $default_revision, $published_state);
/**
- * Operates on the bundle definition that has been marked as moderated.
- *
- * Note: The values on the EntityModerationForm itself are already saved
- * so do not need to be saved here. If any changes are made to the bundle
- * object here it is this method's responsibility to call save() on it.
- *
- * The most common use case is to force revisions on for this bundle if
- * moderation is enabled. That, sadly, does not have a common API in core.
- *
- * @param \Drupal\Core\Config\Entity\ConfigEntityInterface $bundle
- * The bundle definition that is being saved.
- */
- public function onBundleModerationConfigurationFormSubmit(ConfigEntityInterface $bundle);
-
- /**
* Alters entity forms to enforce revision handling.
*
* @param array $form