]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/CoreBundle/Controller/EntryController.php
Set a starred_at field when an entry is starred.
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Controller / EntryController.php
index 445cfeebe627c3696cbf296a5686f392b5aa7cb4..b0b74c381641c97425f6dca473f7ddd36bde89ea 100644 (file)
@@ -195,7 +195,7 @@ class EntryController extends Controller
     public function showUnreadAction(Request $request, $page)
     {
         // load the quickstart if no entry in database
-        if ($page === 1 && $this->get('wallabag_core.entry_repository')->countAllEntriesByUser($this->getUser()->getId()) === 0) {
+        if ((int) $page === 1 && $this->get('wallabag_core.entry_repository')->countAllEntriesByUser($this->getUser()->getId()) === 0) {
             return $this->redirect($this->generateUrl('quickstart'));
         }
 
@@ -333,6 +333,7 @@ class EntryController extends Controller
         $this->checkUserAction($entry);
 
         $entry->toggleStar();
+        $entry->updateStar($entry->isStarred());
         $this->getDoctrine()->getManager()->flush();
 
         $message = 'flashes.entry.notice.entry_unstarred';
@@ -573,6 +574,7 @@ class EntryController extends Controller
                 'entries' => $entries,
                 'currentPage' => $page,
                 'searchTerm' => $searchTerm,
+                'isFiltered' => $form->isSubmitted(),
             ]
         );
     }