diff options
author | Nicolas LÅ“uillet <nicolas@loeuillet.org> | 2017-05-31 11:48:42 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-31 11:48:42 +0200 |
commit | d61fd8be4ffdbba8d0fd02468075602a26dfde1a (patch) | |
tree | 6cd4aa0f3e236299d963c26fb3a17ba3b4dfc34e /src/Wallabag | |
parent | 3f8578ded3d8f5d1a987abc50064c8e97bb96f2e (diff) | |
parent | 31485bddb98a2a1b434e62e02ffd79614eca9db8 (diff) | |
download | wallabag-d61fd8be4ffdbba8d0fd02468075602a26dfde1a.tar.gz wallabag-d61fd8be4ffdbba8d0fd02468075602a26dfde1a.tar.zst wallabag-d61fd8be4ffdbba8d0fd02468075602a26dfde1a.zip |
Merge pull request #3138 from Kdecherf/2835-tags
Ignore ActionMarkAsRead when removing tag from entry
Diffstat (limited to 'src/Wallabag')
-rw-r--r-- | src/Wallabag/CoreBundle/Controller/TagController.php | 2 | ||||
-rw-r--r-- | src/Wallabag/CoreBundle/Helper/Redirect.php | 10 |
2 files changed, 7 insertions, 5 deletions
diff --git a/src/Wallabag/CoreBundle/Controller/TagController.php b/src/Wallabag/CoreBundle/Controller/TagController.php index fb6a720b..736eb1dc 100644 --- a/src/Wallabag/CoreBundle/Controller/TagController.php +++ b/src/Wallabag/CoreBundle/Controller/TagController.php | |||
@@ -70,7 +70,7 @@ class TagController extends Controller | |||
70 | $em->flush(); | 70 | $em->flush(); |
71 | } | 71 | } |
72 | 72 | ||
73 | $redirectUrl = $this->get('wallabag_core.helper.redirect')->to($request->headers->get('referer')); | 73 | $redirectUrl = $this->get('wallabag_core.helper.redirect')->to($request->headers->get('referer'), '', true); |
74 | 74 | ||
75 | return $this->redirect($redirectUrl); | 75 | return $this->redirect($redirectUrl); |
76 | } | 76 | } |
diff --git a/src/Wallabag/CoreBundle/Helper/Redirect.php b/src/Wallabag/CoreBundle/Helper/Redirect.php index f78b7fe0..abc84d08 100644 --- a/src/Wallabag/CoreBundle/Helper/Redirect.php +++ b/src/Wallabag/CoreBundle/Helper/Redirect.php | |||
@@ -21,12 +21,13 @@ class Redirect | |||
21 | } | 21 | } |
22 | 22 | ||
23 | /** | 23 | /** |
24 | * @param string $url URL to redirect | 24 | * @param string $url URL to redirect |
25 | * @param string $fallback Fallback URL if $url is null | 25 | * @param string $fallback Fallback URL if $url is null |
26 | * @param bool $ignoreActionMarkAsRead Ignore configured action when mark as read | ||
26 | * | 27 | * |
27 | * @return string | 28 | * @return string |
28 | */ | 29 | */ |
29 | public function to($url, $fallback = '') | 30 | public function to($url, $fallback = '', $ignoreActionMarkAsRead = false) |
30 | { | 31 | { |
31 | $user = $this->tokenStorage->getToken() ? $this->tokenStorage->getToken()->getUser() : null; | 32 | $user = $this->tokenStorage->getToken() ? $this->tokenStorage->getToken()->getUser() : null; |
32 | 33 | ||
@@ -34,7 +35,8 @@ class Redirect | |||
34 | return $url; | 35 | return $url; |
35 | } | 36 | } |
36 | 37 | ||
37 | if (Config::REDIRECT_TO_HOMEPAGE === $user->getConfig()->getActionMarkAsRead()) { | 38 | if (!$ignoreActionMarkAsRead && |
39 | Config::REDIRECT_TO_HOMEPAGE === $user->getConfig()->getActionMarkAsRead()) { | ||
38 | return $this->router->generate('homepage'); | 40 | return $this->router->generate('homepage'); |
39 | } | 41 | } |
40 | 42 | ||