diff --git a/src/Plugin/migrate/destination/DisqusComment.php b/src/Plugin/migrate/destination/DisqusComment.php index 33c7b40..b7895ab 100644 --- a/src/Plugin/migrate/destination/DisqusComment.php +++ b/src/Plugin/migrate/destination/DisqusComment.php @@ -18,6 +18,7 @@ use Symfony\Component\DependencyInjection\ContainerInterface; * ) */ class DisqusComment extends DestinationBase implements ContainerFactoryPluginInterface { + const PUBLIC_API_KEY = 'E8Uh5l5fHZ6gD8U3KycjAIAk46f68Zw7C6eW8WSjZvCLXebZ7p0r1yrYDrLilk2F'; /** * A logger instance. @@ -152,19 +153,21 @@ class DisqusComment extends DestinationBase implements ContainerFactoryPluginInt // Cannot create comment as anonymous user, needs 'api_key' // (api_key is not the public key). $ids = ['disqus_id' => $disqus->posts->create([ - 'thread' => $thread, + 'thread' => $thread->id, 'message' => $message, 'author_name' => $author_name, 'author_email' => $author_email, 'author_url' => $author_url, - 'date' => $date, - 'ip_address' => $ip_address, + // Can't set date and ip_address + // 'date' => $date, + // 'ip_address' => $ip_address, + 'api_key' => self::PUBLIC_API_KEY, ])->id]; } return $ids; } catch (\Exception $exception) { - $this->logger->error('Error creating post on thread @thread.', array('@thread' => $thread->id)); + $this->logger->error('Error creating post on thread @thread, error: @error', array('@thread' => $thread->id, '@error' => $exception->getMessage())); } return FALSE; } @@ -205,4 +208,4 @@ class DisqusComment extends DestinationBase implements ContainerFactoryPluginInt return FALSE; } } -} +} \ No newline at end of file