forked from wallabag/wallabag
Ability to reload an entry
Could be useful when we want to update the content or when the content failed to be fetched. Fix #1503
This commit is contained in:
@ -266,6 +266,33 @@ class EntryController extends Controller
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reload an entry.
|
||||
* Refetch content from the website and make it readable again.
|
||||
*
|
||||
* @param Entry $entry
|
||||
*
|
||||
* @Route("/reload/{id}", requirements={"id" = "\d+"}, name="reload_entry")
|
||||
*
|
||||
* @return \Symfony\Component\HttpFoundation\RedirectResponse
|
||||
*/
|
||||
public function reloadAction(Entry $entry)
|
||||
{
|
||||
$this->checkUserAction($entry);
|
||||
|
||||
$message = 'Entry reloaded';
|
||||
if (false === $this->updateEntry($entry)) {
|
||||
$message = 'Failed to reload entry';
|
||||
}
|
||||
|
||||
$this->get('session')->getFlashBag()->add(
|
||||
'notice',
|
||||
$message
|
||||
);
|
||||
|
||||
return $this->redirect($this->generateUrl('view', array('id' => $entry->getId())));
|
||||
}
|
||||
|
||||
/**
|
||||
* Changes read status for an entry.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user