diff options
author | Jérémy Benoist <j0k3r@users.noreply.github.com> | 2017-12-14 11:19:44 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-14 11:19:44 +0100 |
commit | a68a80f654be86ae25d49420b86099302ce55bb6 (patch) | |
tree | 158cb4743920e91f87f2194287b81095f527bad2 /src/Wallabag/ApiBundle/Controller | |
parent | 70265817aee257e7e635eda79ce3e037e3b4a242 (diff) | |
parent | b457d7bd32b0eb228f6802d92630d8f0524f042f (diff) | |
download | wallabag-a68a80f654be86ae25d49420b86099302ce55bb6.tar.gz wallabag-a68a80f654be86ae25d49420b86099302ce55bb6.tar.zst wallabag-a68a80f654be86ae25d49420b86099302ce55bb6.zip |
Merge pull request #3442 from wallabag/empty-entry
Fix empty title and domain_name when exception is thrown during fetch
Diffstat (limited to 'src/Wallabag/ApiBundle/Controller')
-rw-r--r-- | src/Wallabag/ApiBundle/Controller/EntryRestController.php | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/Wallabag/ApiBundle/Controller/EntryRestController.php b/src/Wallabag/ApiBundle/Controller/EntryRestController.php index 7d820c7e..acca219f 100644 --- a/src/Wallabag/ApiBundle/Controller/EntryRestController.php +++ b/src/Wallabag/ApiBundle/Controller/EntryRestController.php | |||
@@ -381,6 +381,14 @@ class EntryRestController extends WallabagRestController | |||
381 | } | 381 | } |
382 | } | 382 | } |
383 | 383 | ||
384 | if (empty($entry->getDomainName())) { | ||
385 | $this->get('wallabag_core.content_proxy')->setEntryDomainName($entry); | ||
386 | } | ||
387 | |||
388 | if (empty($entry->getTitle())) { | ||
389 | $this->get('wallabag_core.content_proxy')->setDefaultEntryTitle($entry); | ||
390 | } | ||
391 | |||
384 | $em = $this->getDoctrine()->getManager(); | 392 | $em = $this->getDoctrine()->getManager(); |
385 | $em->persist($entry); | 393 | $em->persist($entry); |
386 | $em->flush(); | 394 | $em->flush(); |
@@ -490,6 +498,14 @@ class EntryRestController extends WallabagRestController | |||
490 | $entry->setOriginUrl($data['origin_url']); | 498 | $entry->setOriginUrl($data['origin_url']); |
491 | } | 499 | } |
492 | 500 | ||
501 | if (empty($entry->getDomainName())) { | ||
502 | $this->get('wallabag_core.content_proxy')->setEntryDomainName($entry); | ||
503 | } | ||
504 | |||
505 | if (empty($entry->getTitle())) { | ||
506 | $this->get('wallabag_core.content_proxy')->setDefaultEntryTitle($entry); | ||
507 | } | ||
508 | |||
493 | $em = $this->getDoctrine()->getManager(); | 509 | $em = $this->getDoctrine()->getManager(); |
494 | $em->persist($entry); | 510 | $em->persist($entry); |
495 | $em->flush(); | 511 | $em->flush(); |