X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2FWallabag%2FCoreBundle%2FController%2FEntryController.php;h=97bb3d12fa3b07afc7ef8a4620e1ae512d946151;hb=2297d60f100effc1bf4300488a170a6bed3ae756;hp=3b28e635025253a8a7baa1c4eb6ff6c12600aba4;hpb=7180aaed45dce62e40620a9e4b202526ebd6a3bb;p=github%2Fwallabag%2Fwallabag.git diff --git a/src/Wallabag/CoreBundle/Controller/EntryController.php b/src/Wallabag/CoreBundle/Controller/EntryController.php index 3b28e635..97bb3d12 100644 --- a/src/Wallabag/CoreBundle/Controller/EntryController.php +++ b/src/Wallabag/CoreBundle/Controller/EntryController.php @@ -330,6 +330,15 @@ class EntryController extends Controller $this->updateEntry($entry, 'entry_reloaded'); + // if refreshing entry failed, don't save it + if ($this->getParameter('wallabag_core.fetching_error_message') === $entry->getContent()) { + $bag = $this->get('session')->getFlashBag(); + $bag->clear(); + $bag->add('notice', 'flashes.entry.notice.entry_reloaded_failed'); + + return $this->redirect($this->generateUrl('view', ['id' => $entry->getId()])); + } + $em = $this->getDoctrine()->getManager(); $em->persist($entry); $em->flush();