1
0
Fork 0
mirror of https://github.com/wallabag/wallabag.git synced 2025-10-15 19:42:08 +00:00

Merge pull request #3138 from Kdecherf/2835-tags

Ignore ActionMarkAsRead when removing tag from entry
This commit is contained in:
Nicolas Lœuillet 2017-05-31 11:48:42 +02:00 committed by GitHub
commit d61fd8be4f
4 changed files with 35 additions and 5 deletions

View file

@ -70,7 +70,7 @@ class TagController extends Controller
$em->flush();
}
$redirectUrl = $this->get('wallabag_core.helper.redirect')->to($request->headers->get('referer'));
$redirectUrl = $this->get('wallabag_core.helper.redirect')->to($request->headers->get('referer'), '', true);
return $this->redirect($redirectUrl);
}

View file

@ -21,12 +21,13 @@ class Redirect
}
/**
* @param string $url URL to redirect
* @param string $fallback Fallback URL if $url is null
* @param string $url URL to redirect
* @param string $fallback Fallback URL if $url is null
* @param bool $ignoreActionMarkAsRead Ignore configured action when mark as read
*
* @return string
*/
public function to($url, $fallback = '')
public function to($url, $fallback = '', $ignoreActionMarkAsRead = false)
{
$user = $this->tokenStorage->getToken() ? $this->tokenStorage->getToken()->getUser() : null;
@ -34,7 +35,8 @@ class Redirect
return $url;
}
if (Config::REDIRECT_TO_HOMEPAGE === $user->getConfig()->getActionMarkAsRead()) {
if (!$ignoreActionMarkAsRead &&
Config::REDIRECT_TO_HOMEPAGE === $user->getConfig()->getActionMarkAsRead()) {
return $this->router->generate('homepage');
}