]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/ImportBundle/Import/BrowserImport.php
Merge pull request #2500 from wallabag/add-check-composer
[github/wallabag/wallabag.git] / src / Wallabag / ImportBundle / Import / BrowserImport.php
index e15443c40a6de26ac485b321658c496d79fda853..2ca1683b1688b33ff7c9e203e635b0bb83b09f7a 100644 (file)
@@ -45,6 +45,8 @@ abstract class BrowserImport extends AbstractImport
         $data = json_decode(file_get_contents($this->filepath), true);
 
         if (empty($data)) {
+            $this->logger->error('Wallabag Browser: no entries in imported file');
+
             return false;
         }
 
@@ -137,12 +139,24 @@ abstract class BrowserImport extends AbstractImport
     public function parseEntry(array $importedEntry)
     {
         if ((!array_key_exists('guid', $importedEntry) || (!array_key_exists('id', $importedEntry))) && is_array(reset($importedEntry))) {
+            if ($this->producer) {
+                $this->parseEntriesForProducer($importedEntry);
+
+                return;
+            }
+
             $this->parseEntries($importedEntry);
 
             return;
         }
 
         if (array_key_exists('children', $importedEntry)) {
+            if ($this->producer) {
+                $this->parseEntriesForProducer($importedEntry['children']);
+
+                return;
+            }
+
             $this->parseEntries($importedEntry['children']);
 
             return;