From acbd45d5303208561fe038d832c513bd6df3dfc2 Mon Sep 17 00:00:00 2001 From: Marcin Kurczewski Date: Mon, 19 May 2014 01:04:22 +0200 Subject: [PATCH] Fixed mass tag --- src/Controllers/TagController.php | 4 +++- src/Views/tag/tag-list-wrapper.phtml | 2 +- src/routes.php | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Controllers/TagController.php b/src/Controllers/TagController.php index a1ff0056..5868c84d 100644 --- a/src/Controllers/TagController.php +++ b/src/Controllers/TagController.php @@ -142,12 +142,14 @@ class TagController extends AbstractController $params = [ 'source' => 'mass-tag', - 'query' => $suppliedQuery ?: '', + 'query' => trim($suppliedQuery ?: ''), 'additionalInfo' => $suppliedTag ? $suppliedTag : '', ]; if ($suppliedOldPage != 0 and $suppliedOldQuery == $suppliedQuery) $params['page'] = $suppliedOldPage; + else + $params['page'] = 1; $url = \Chibi\Router::linkTo(['PostController', 'listView'], $params); $this->redirect($url); diff --git a/src/Views/tag/tag-list-wrapper.phtml b/src/Views/tag/tag-list-wrapper.phtml index b255fdaa..0f8b9af1 100644 --- a/src/Views/tag/tag-list-wrapper.phtml +++ b/src/Views/tag/tag-list-wrapper.phtml @@ -13,7 +13,7 @@ if (Access::check(new Privilege(Privilege::MergeTags))) $tabs['merge'] = ['Merge', 'mergeView']; if (Access::check(new Privilege(Privilege::MassTag))) - $tabs['mass-tag'] = ['Mass tag', 'massTagRedirectAction']; + $tabs['mass-tag'] = ['Mass tag', 'massTagRedirectView']; $showTabs = count($tabs) > 1; ?> diff --git a/src/routes.php b/src/routes.php index f62e84d4..60469db3 100644 --- a/src/routes.php +++ b/src/routes.php @@ -40,7 +40,7 @@ $postValidation = \Chibi\Router::register(['PostController', 'listView'], 'GET', '/{source}/{page}', $postValidation); \Chibi\Router::register(['PostController', 'listView'], 'GET', '/{source}/{query}/{page}', $postValidation); \Chibi\Router::register(['PostController', 'listView'], 'GET', '/{source}/{query}/{additionalInfo}/{page}', $postValidation); -\Chibi\Router::register(['PostController', 'listRedirectAction'], 'POST', '/{source}-redirect', $postValidation); +\Chibi\Router::register(['PostController', 'listRedirectAction'], 'POST', '/posts-redirect', $postValidation); \Chibi\Router::register(['PostController', 'randomView'], 'GET', '/random', $postValidation); \Chibi\Router::register(['PostController', 'randomView'], 'GET', '/random/{page}', $postValidation);