From bd128e609c13dbcac9874997442468553a95c264 Mon Sep 17 00:00:00 2001 From: Neodork Date: Wed, 18 May 2016 16:49:07 +0200 Subject: [PATCH] Fixed tree view showing if no filter is defined This fixed the tree view showing if no filter is defined, show list view instead. The tree view has no functionality for SonataAdminBundle's sonata_type_model causing a BC break. --- CHANGELOG.md | 4 ++++ Controller/PageAdminController.php | 2 +- Resources/views/PageAdmin/list_tab_menu.html.twig | 6 ++++-- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1a17b7d69..b63584c59 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ A [BC BREAK] means the update will break the project for many reasons: * new dependencies * class refactoring +## [Unreleased] +### Fixed +- Tree view showing if no filter is defined, show SonataAdminBundle list view instead. Caused a BC break with the form type: sonata_type_model. + ### 2014-11-04 * [BC BREAK] Move assets management (js, css) to gulp and move css to sass. diff --git a/Controller/PageAdminController.php b/Controller/PageAdminController.php index e5bf2e0c2..e65efb3ea 100644 --- a/Controller/PageAdminController.php +++ b/Controller/PageAdminController.php @@ -53,7 +53,7 @@ public function batchActionSnapshot($query) */ public function listAction(Request $request = null) { - if (!$request->get('filter')) { + if ($request->get('filter')) { return new RedirectResponse($this->admin->generateUrl('tree')); } diff --git a/Resources/views/PageAdmin/list_tab_menu.html.twig b/Resources/views/PageAdmin/list_tab_menu.html.twig index ed0f6851e..99074626d 100644 --- a/Resources/views/PageAdmin/list_tab_menu.html.twig +++ b/Resources/views/PageAdmin/list_tab_menu.html.twig @@ -1,10 +1,12 @@ {{ knp_menu_render(admin.sidemenu(action), {'currentClass' : 'active'}, 'list') }}

- + {{ 'pages.list_mode'|trans({}, 'SonataPageBundle') }} - + {{ 'pages.tree_mode'|trans({}, 'SonataPageBundle') }}