Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tree view BC break #639

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion Controller/PageAdminController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
}

Expand Down
6 changes: 4 additions & 2 deletions Resources/views/PageAdmin/list_tab_menu.html.twig
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
{{ knp_menu_render(admin.sidemenu(action), {'currentClass' : 'active'}, 'list') }}
<p>
<div class="btn-group">
<a type="button" class="btn {% if mode == 'list' %}btn-info active{% else %}btn-default{% endif %}" href="{{ admin.generateUrl('list', { 'filter': { 'site': { 'value': currentSite.id|default('') }}}) }}">
<a type="button" class="btn {% if mode == 'list' %}btn-info active{% else %}btn-default{% endif %}"
href="{{ admin.generateUrl('list') }}">
<i class="fa fa-list"></i> {{ 'pages.list_mode'|trans({}, 'SonataPageBundle') }}
</a>
<a type="button" class="btn {% if mode == 'tree' %}btn-info active{% else %}btn-default{% endif %}" href="{{ admin.generateUrl('tree') }}">
<a type="button" class="btn {% if mode == 'tree' %}btn-info active{% else %}btn-default{% endif %}"
href="{{ admin.generateUrl('tree', { 'filter': { 'site': { 'value': currentSite.id|default('') }}}) }}">
<i class="fa fa-sitemap"></i> {{ 'pages.tree_mode'|trans({}, 'SonataPageBundle') }}
</a>
</div>
Expand Down