Unverified Commit fc46c7f3 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3092606 by andypost, Wim Leers, Berdir, longwave: Remove comment.module BC layers

parent 46bd90dc
Loading
Loading
Loading
Loading
+0 −87
Original line number Diff line number Diff line
@@ -28,36 +28,6 @@
use Drupal\user\RoleInterface;
use Drupal\user\UserInterface;

/**
 * Anonymous posters cannot enter their contact information.
 *
 * @deprecated in drupal:8.3.0 and is removed from drupal:9.0.0.
 *   Use \Drupal\comment\CommentInterface::ANONYMOUS_MAYNOT_CONTACT instead.
 *
 * @see https://www.drupal.org/node/2831620
 */
const COMMENT_ANONYMOUS_MAYNOT_CONTACT = 0;

/**
 * Anonymous posters may leave their contact information.
 *
 * @deprecated in drupal:8.3.0 and is removed from drupal:9.0.0.
 *   Use \Drupal\comment\CommentInterface::ANONYMOUS_MAY_CONTACT instead.
 *
 * @see https://www.drupal.org/node/2831620
 */
const COMMENT_ANONYMOUS_MAY_CONTACT = 1;

/**
 * Anonymous posters are required to leave their contact information.
 *
 * @deprecated in drupal:8.3.0 and is removed from drupal:9.0.0.
 *   Use \Drupal\comment\CommentInterface::ANONYMOUS_MUST_CONTACT instead.
 *
 * @see https://www.drupal.org/node/2831620
 */
const COMMENT_ANONYMOUS_MUST_CONTACT = 2;

/**
 * The time cutoff for comments marked as read for entity types other node.
 *
@@ -259,63 +229,6 @@ function comment_node_view_alter(array &$build, EntityInterface $node, EntityVie
  }
}

/**
 * Generates an array for rendering a comment.
 *
 * @param \Drupal\comment\CommentInterface $comment
 *   The comment object.
 * @param string $view_mode
 *   (optional) View mode; for instance, 'full', 'teaser', etc. Defaults to
 *   'full'.
 * @param string $langcode
 *   (optional) A language code to use for rendering. Defaults to the global
 *   content language of the current request.
 *
 * @return array
 *   An array as expected by \Drupal\Core\Render\RendererInterface::render().
 *
 * @deprecated in drupal:8.0.0 and is removed from drupal:9.0.0.
 *   Use \Drupal::entityTypeManager()->getViewBuilder('comment')->view().
 *
 * @see https://www.drupal.org/node/3033656
 */
function comment_view(CommentInterface $comment, $view_mode = 'full', $langcode = NULL) {
  @trigger_error("comment_view() is deprecated in Drupal 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal::entityTypeManager()->getViewBuilder('comment')->view() instead. See https://www.drupal.org/node/3033656", E_USER_DEPRECATED);
  return \Drupal::entityTypeManager()
    ->getViewBuilder('comment')
    ->view($comment, $view_mode, $langcode);
}

/**
 * Constructs render array from an array of loaded comments.
 *
 * @param \Drupal\comment\CommentInterface[] $comments
 *   An array of comments as returned by entity_load_multiple().
 * @param string $view_mode
 *   (optional) View mode; for instance, 'full', 'teaser', etc. Defaults to
 *   'full'.
 * @param string $langcode
 *   (optional) A string indicating the language field values are to be shown
 *   in. If no language is provided the current content language is used.
 *   Defaults to NULL.
 *
 * @return array
 *   An array in the format expected by
 *   \Drupal\Core\Render\RendererInterface::render().
 *
 * @deprecated in drupal:8.0.0 and is removed from drupal:9.0.0.
 *   Use \Drupal::entityTypeManager()->getViewBuilder('comment')->viewMultiple().
 *
 * @see https://www.drupal.org/node/3033656
 * @see \Drupal\Core\Render\RendererInterface::render()
 */
function comment_view_multiple($comments, $view_mode = 'full', $langcode = NULL) {
  @trigger_error("comment_view_multiple() is deprecated in Drupal 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal::entityTypeManager()->getViewBuilder('comment')->viewMultiple() instead. See https://www.drupal.org/node/3033656", E_USER_DEPRECATED);
  return \Drupal::entityTypeManager()
    ->getViewBuilder('comment')
    ->viewMultiple($comments, $view_mode, $langcode);
}

/**
 * Implements hook_form_FORM_ID_alter() for field_ui_field_storage_add_form.
 */
+0 −24
Original line number Diff line number Diff line
@@ -22,18 +22,6 @@ field.widget.settings.comment_default:
  type: mapping
  label: 'Comment display format settings'

# @deprecated in Drupal 8.5.x, to be removed before Drupal 9.0.0.
# @see https://www.drupal.org/node/2919303
action.configuration.comment_publish_action:
  type: action_configuration_default
  label: 'Publish comment configuration'

# @deprecated in Drupal 8.5.x, to be removed before Drupal 9.0.0.
# @see https://www.drupal.org/node/2919303
action.configuration.comment_save_action:
  type: action_configuration_default
  label: 'Save comment configuration'

action.configuration.comment_unpublish_by_keyword_action:
  type: mapping
  label: 'Unpublish comment containing keyword(s) configuration'
@@ -45,18 +33,6 @@ action.configuration.comment_unpublish_by_keyword_action:
        type: string
        label: 'Keyword'

# @deprecated in Drupal 8.5.x, to be removed before Drupal 9.0.0.
# @see https://www.drupal.org/node/2919303
action.configuration.comment_unpublish_action:
  type: action_configuration_default
  label: 'Unpublish comment configuration'

# @deprecated in Drupal 8.6.x, to be removed before Drupal 9.0.0.
# @see https://www.drupal.org/node/2934349
action.configuration.comment_delete_action:
  type: action_configuration_default
  label: 'Delete comment configuration'

comment.type.*:
  type: config_entity
  label: 'Comment type settings'
+0 −14
Original line number Diff line number Diff line
@@ -208,20 +208,6 @@ public function getCreatedTime();
   */
  public function setCreatedTime($created);

  /**
   * Returns the comment's status.
   *
   * @return int|string|bool
   *   Either TRUE, '1', or CommentInterface::PUBLISHED(1) if the comment is
   *   published, or FALSE, '0', or CommentInterface::NOT_PUBLISHED(0) if the
   *   comment is not published.
   *
   * @deprecated in drupal:8.3.0 and is removed from drupal:9.0.0. Use
   *   \Drupal\Core\Entity\EntityPublishedInterface::isPublished() instead.
   * @see https://www.drupal.org/node/2830201
   */
  public function getStatus();

  /**
   * Returns the alphadecimal representation of the comment's place in a thread.
   *
+0 −8
Original line number Diff line number Diff line
@@ -479,14 +479,6 @@ public function setCreatedTime($created) {
    return $this;
  }

  /**
   * {@inheritdoc}
   */
  public function getStatus() {
    @trigger_error(__NAMESPACE__ . '\Comment::getStatus() is deprecated in drupal:8.3.0 and is removed from drupal:9.0.0. Use \Drupal\Core\Entity\EntityPublishedInterface::isPublished() instead. See https://www.drupal.org/node/2830201', E_USER_DEPRECATED);
    return $this->get('status')->value;
  }

  /**
   * {@inheritdoc}
   */
+0 −34
Original line number Diff line number Diff line
<?php

namespace Drupal\comment\Plugin\Action;

use Drupal\Core\Action\Plugin\Action\DeleteAction;
use Drupal\Core\Entity\EntityTypeManagerInterface;
use Drupal\Core\Session\AccountInterface;
use Drupal\Core\TempStore\PrivateTempStoreFactory;

/**
 * Deletes a comment.
 *
 * @deprecated in drupal:8.6.0 and is removed from drupal:9.0.0.
 *   Use \Drupal\Core\Action\Plugin\Action\DeleteAction instead.
 *
 * @see \Drupal\Core\Action\Plugin\Action\DeleteAction
 * @see https://www.drupal.org/node/2934349
 *
 * @Action(
 *   id = "comment_delete_action",
 *   label = @Translation("Delete comment")
 * )
 */
class DeleteComment extends DeleteAction {

  /**
   * {@inheritdoc}
   */
  public function __construct(array $configuration, $plugin_id, $plugin_definition, EntityTypeManagerInterface $entity_type_manager, PrivateTempStoreFactory $temp_store_factory, AccountInterface $current_user) {
    parent::__construct($configuration, $plugin_id, $plugin_definition, $entity_type_manager, $temp_store_factory, $current_user);
    @trigger_error(__NAMESPACE__ . '\DeleteComment is deprecated in Drupal 8.6.x, will be removed before Drupal 9.0.0. Use \Drupal\Core\Action\Plugin\Action\DeleteAction instead. See https://www.drupal.org/node/2934349.', E_USER_DEPRECATED);
  }

}
Loading