1
0
Fork 0
mirror of https://github.com/wallabag/wallabag.git synced 2025-07-27 17:28:39 +00:00

If reload content failed, don’t update it

In case user wants a fresh version of the current one and the website isn’t available, don’t erase it with a boring message saying wallabag wasn’t able to refresh the content.
This commit is contained in:
Jeremy Benoist 2016-10-20 22:49:46 +02:00
parent 7180aaed45
commit 2297d60f10
No known key found for this signature in database
GPG key ID: BCA73962457ACC3C
6 changed files with 55 additions and 2 deletions

View file

@ -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();