Skip to content

Commit

Permalink
BUGFIX Don't filter AssetAdmin list view when showing detail view (fi…
Browse files Browse the repository at this point in the history
…xes #7408)
  • Loading branch information
chillu committed Jun 5, 2012
1 parent 63467b0 commit 8b8de05
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions code/controllers/AssetAdmin.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -91,6 +91,13 @@ public function getList() {
$params = $this->request->requestVar('q'); $params = $this->request->requestVar('q');
$list = $context->getResults($params); $list = $context->getResults($params);


// Don't filter list when a detail view is requested,
// to avoid edge cases where the filtered list wouldn't contain the requested
// record due to faulty session state (current folder not always encoded in URL, see #7408).
if($this->request->param('ID') == 'field') {
return $list;
}

// Re-add previously removed "Name" filter as combined filter // Re-add previously removed "Name" filter as combined filter
// TODO Replace with composite SearchFilter once that API exists // TODO Replace with composite SearchFilter once that API exists
if(isset($params['Name'])) { if(isset($params['Name'])) {
Expand Down

2 comments on commit 8b8de05

@ajoneil
Copy link
Contributor

@ajoneil ajoneil commented on 8b8de05 Sep 3, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This breaks pagination in AssetAdmin - the gridfield will lose the context of which folder it is in and show files from all folders.

@chillu
Copy link
Member Author

@chillu chillu commented on 8b8de05 Sep 3, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ajoneil Wanna file a new bug for it?

Please sign in to comment.