diff --git a/src/Plugin/migrate/source/DisqusComment.php b/src/Plugin/migrate/source/DisqusComment.php index 4108a6d..12127eb 100644 --- a/src/Plugin/migrate/source/DisqusComment.php +++ b/src/Plugin/migrate/source/DisqusComment.php @@ -142,16 +142,16 @@ class DisqusComment extends SourcePluginBase implements ContainerFactoryPluginIn */ public function initializeIterator() { if ($disqus = disqus_api()) { + $items = array(); try { $posts = $disqus->forums->listPosts(array('forum' => $this->config->get('disqus_domain'))); } catch (\Exception $exception) { - drupal_set_message(t('There was an error loading the forum details. Please check you API keys and try again.', 'error')); + drupal_set_message(t('There was an error loading the forum details. Please check you API keys and try again.'), 'error'); $this->logger->error('Error loading the Disqus PHP API. Check your forum name.', array()); - return FALSE; + return new \ArrayIterator($items); } - $items = array(); foreach ($posts as $post) { $id = $post['id']; $items[$id]['id'] = $id;