Skip to content

Commit

Permalink
bugfix: sorting session
Browse files Browse the repository at this point in the history
  • Loading branch information
ad3n committed May 13, 2016
1 parent bd38d28 commit a477d48
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions EventListener/EnableFieldsSorterListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
use Symfonian\Indonesia\AdminBundle\Event\FilterQueryEvent;
use Symfonian\Indonesia\AdminBundle\Manager\Driver;
use Symfonian\Indonesia\AdminBundle\Manager\ManagerFactory;
use Symfonian\Indonesia\AdminBundle\SymfonianIndonesiaAdminConstants as Constants;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\HttpKernel\Event\FilterControllerEvent;
Expand Down Expand Up @@ -89,6 +90,13 @@ public function onFilterQuery(FilterQueryEvent $event)
return;
}

$session = $this->container->get('session');
if (!$this->sortBy) {
$session->set(Constants::SESSION_SORTED_NAME, null);
return;
}
$session->set(Constants::SESSION_SORTED_NAME, $this->sortBy);

if (ManagerFactory::DOCTRINE_ORM === $this->driver) {
/** @var FieldsSorter $filter */
$filter = $this->container->get('symfonian_id.admin.filter.orm.sort');
Expand Down

0 comments on commit a477d48

Please sign in to comment.