Commit 6237dbf2 authored by Gaurav Kapoor's avatar Gaurav Kapoor Committed by Gaurav Kapoor
Browse files

Issue #3254278 by gaurav.kapoor: Remove all the unwanted and deprecated code

parent 9bd7f01c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -253,7 +253,7 @@ function disqus_theme() {
/**
 * Creates an instance of the Disqus PHP API.
 *
 * @return object
 * @return object|bool
 *   The instance of the Disqus API.
 */
function disqus_api() {
+1 −3
Original line number Diff line number Diff line
@@ -9,8 +9,6 @@ use Drupal\Core\Entity\EntityTypeManagerInterface;
use Drupal\Core\Session\AccountInterface;
use Drupal\Core\Extension\ModuleHandlerInterface;
use Drupal\Core\Url;
use Drupal\file\Entity\File;
use Drupal\user\Entity\User;

/**
 * It contains common functions to manage disqus_comment fields.
@@ -122,7 +120,7 @@ class DisqusCommentManager implements DisqusCommentManagerInterface {
    $managed_logo = $this->configFactory->get('disqus.settings')->get('advanced.sso.disqus_logo');
    $use_site_logo = $this->configFactory->get('disqus.settings')->get('advanced.sso.disqus_use_site_logo');
    if (!$use_site_logo && !empty($managed_logo)) {
      $disqus['sso']['button'] = $this->entityTypeManager->getStorage('file')->load($managed_logo)->url();
      $disqus['sso']['button'] = $this->entityTypeManager->getStorage('file')->load($managed_logo)->toUrl();
    }
    elseif ($logo = theme_get_setting('logo')) {
      $url = $logo['url'];
+8 −7
Original line number Diff line number Diff line
@@ -2,13 +2,14 @@

namespace Drupal\disqus\Form;

use Drupal\Core\Entity\EntityTypeManagerInterface;
use Drupal\Core\Form\ConfigFormBase;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Drupal\disqus\DisqusCommentManagerInterface;
use Drupal\file\FileUsage\FileUsageInterface;
use Drupal\Core\Config\ConfigFactoryInterface;
use Drupal\Core\Entity\EntityTypeManagerInterface;
use Drupal\Core\Extension\ModuleHandlerInterface;
use Drupal\file\FileUsage\FileUsageInterface;
use Drupal\Core\Form\ConfigFormBase;
use Drupal\Core\Form\FormStateInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;

/**
 * Provides Disqus settings form.
@@ -188,9 +189,9 @@ class DisqusSettingsForm extends ConfigFormBase {
        '#description' => $this->t('Action to take when deleting a node. (Requires your user access token.)'),
        '#default_value' => $disqus_config->get('advanced.api.disqus_api_delete'),
        '#options' => [
          DISQUS_API_NO_ACTION => $this->t('No Action'),
          DISQUS_API_CLOSE => $this->t('Close Thread'),
          DISQUS_API_REMOVE => $this->t('Remove Thread'),
          DisqusCommentManagerInterface::DISQUS_API_NO_ACTION => $this->t('No Action'),
          DisqusCommentManagerInterface::DISQUS_API_CLOSE => $this->t('Close Thread'),
          DisqusCommentManagerInterface::DISQUS_API_REMOVE => $this->t('Remove Thread'),
        ],
        '#states' => [
          'enabled' => [
+10 −8
Original line number Diff line number Diff line
@@ -152,14 +152,16 @@ class DisqusComment extends DestinationBase implements ContainerFactoryPluginInt
        else {
          // Cannot create comment as anonymous user, needs 'api_key'
          // (api_key is not the public key).
          $ids = ['disqus_id' => $disqus->posts->create([
          $ids = [
            'disqus_id' => $disqus->posts->create([
              'thread' => $thread->id,
              'message' => $message,
              'author_name' => $author_name,
              'author_email' => $author_email,
              'author_url' => $author_url,
              'api_key' => $this->config->get('advanced.disqus_publickey'),
          ])];
            ]),
          ];
        }
        return $ids;
      }
+5 −5
Original line number Diff line number Diff line
@@ -2,14 +2,14 @@

namespace Drupal\disqus\Plugin\migrate\process;

use Drupal\Core\Entity\EntityTypeManagerInterface;
use Drupal\migrate\MigrateSkipRowException;
use Drupal\migrate\MigrateExecutableInterface;
use Drupal\migrate\Plugin\MigrationInterface;
use Drupal\migrate\ProcessPluginBase;
use Drupal\migrate\Row;
use Drupal\migrate\Entity\MigrationInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Drupal\Core\Entity\EntityTypeManagerInterface;
use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
use Drupal\migrate\MigrateSkipRowException;
use Symfony\Component\DependencyInjection\ContainerInterface;

/**
 * Gives the entity_type from the disqus identifier.
@@ -23,7 +23,7 @@ class DisqusEntityType extends ProcessPluginBase implements ContainerFactoryPlug
  /**
   * The entity type manager service.
   *
   * @var \Drupal\Core\Entity\EntityManager
   * @var \Drupal\Core\Entity\EntityTypeManagerInterface
   */
  protected $entityTypeManager;