]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/CoreBundle/Helper/ContentProxy.php
ContentProxy: fix a corner case when entry.url is empty in updateEntry
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Helper / ContentProxy.php
index d4ea608f3c724d6ae9f896199fb23ede3fc96435..f0d8c1b420c9ba5fa192eb43b4949d84d1f79b5a 100644 (file)
@@ -66,6 +66,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);
     }