mirror of
https://github.com/wallabag/wallabag.git
synced 2025-07-22 17:18:37 +00:00
TagController: ignore ActionMarkAsRead when removing tag from entry
Fixes #2835 Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
This commit is contained in:
parent
2150576d86
commit
5dbf3f2326
4 changed files with 29 additions and 5 deletions
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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');
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue