X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2FWallabag%2FCoreBundle%2FController%2FEntryController.php;h=97bb3d12fa3b07afc7ef8a4620e1ae512d946151;hb=f3b637fbfee2fa9f66e53cbadd05e85771eece9d;hp=40111af0b5e37a8209d28745d4e9281bee0225f7;hpb=637aa17e6b52dd8021854a809053560a27caca72;p=github%2Fwallabag%2Fwallabag.git diff --git a/src/Wallabag/CoreBundle/Controller/EntryController.php b/src/Wallabag/CoreBundle/Controller/EntryController.php index 40111af0..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(); @@ -531,7 +540,7 @@ class EntryController extends Controller } return $this->render( - '@WallabagCore/themes/share.html.twig', + '@WallabagCore/themes/common/Entry/share.html.twig', ['entry' => $entry] ); }