]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
ContentProxy: fix a corner case when entry.url is empty in updateEntry
authorKevin Decherf <kevin@kdecherf.com>
Sun, 7 Jan 2018 16:25:26 +0000 (17:25 +0100)
committerKevin Decherf <kevin@kdecherf.com>
Sun, 14 Jan 2018 15:37:03 +0000 (16:37 +0100)
Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
src/Wallabag/CoreBundle/Helper/ContentProxy.php

index fe795d42b5669c967368d685cc334dd0a193e52f..19fcbfbfae9c95d056476ca8bfa9d88ca30de33e 100644 (file)
@@ -65,6 +65,14 @@ class ContentProxy
         // so we'll be able to refetch it in the future
         $content['url'] = !empty($content['url']) ? $content['url'] : $url;
 
+        // In one case (at least in tests), url is empty here
+        // so we set it using $url provided in the updateEntry call.
+        // Not sure what are the other possible cases where this property is empty 
+        if (empty($entry->getUrl()) && !empty($url))
+        {
+            $entry->setUrl($url);
+        }
+
         $this->stockEntry($entry, $content);
     }