Loading disqus.module +1 −1 Original line number Diff line number Diff line Loading @@ -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() { Loading src/DisqusCommentManager.php +1 −3 Original line number Diff line number Diff line Loading @@ -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. Loading Loading @@ -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']; Loading src/Form/DisqusSettingsForm.php +8 −7 Original line number Diff line number Diff line Loading @@ -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. Loading Loading @@ -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' => [ Loading src/Plugin/migrate/destination/DisqusComment.php +10 −8 Original line number Diff line number Diff line Loading @@ -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; } Loading src/Plugin/migrate/process/DisqusEntityType.php +5 −5 Original line number Diff line number Diff line Loading @@ -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. Loading @@ -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; Loading Loading
disqus.module +1 −1 Original line number Diff line number Diff line Loading @@ -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() { Loading
src/DisqusCommentManager.php +1 −3 Original line number Diff line number Diff line Loading @@ -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. Loading Loading @@ -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']; Loading
src/Form/DisqusSettingsForm.php +8 −7 Original line number Diff line number Diff line Loading @@ -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. Loading Loading @@ -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' => [ Loading
src/Plugin/migrate/destination/DisqusComment.php +10 −8 Original line number Diff line number Diff line Loading @@ -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; } Loading
src/Plugin/migrate/process/DisqusEntityType.php +5 −5 Original line number Diff line number Diff line Loading @@ -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. Loading @@ -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; Loading