Rewrote code & fix tests

This commit is contained in:
Jeremy Benoist
2017-06-01 11:31:45 +02:00
parent 843182c7cf
commit 6acadf8e98
11 changed files with 71 additions and 101 deletions

View File

@ -115,14 +115,11 @@ abstract class AbstractImport implements ImportInterface
*/
protected function fetchContent(Entry $entry, $url, array $content = [])
{
// be sure to set at least the given url
$content['url'] = isset($content['url']) ? $content['url'] : $url;
try {
$this->contentProxy->importEntry($entry, $content, $this->disableContentUpdate);
$this->contentProxy->updateEntry($entry, $url, $content, $this->disableContentUpdate);
} catch (\Exception $e) {
$this->logger->error('Error trying to import an entry.', [
'entry_url' => $content['url'],
'entry_url' => $url,
'error_msg' => $e->getMessage(),
]);
}