Skip to content

BUG when you set default filters and try to manipulate query #739

Closed

Description

@gribos

sample code :

    $grid = $this->get('grid');
    $grid->setDefaultFilters(array(
        'closeDate' => array('operator' => 'isNull')
    ));
    $source->manipulateQuery(
        function ($query) use ($tableAlias, $grid) {
            $fileFilter = $grid->getFilter('files.type.id');
            if ($fileFilter && $fileFilter->getOperator() === 'neq') {
                $query->orWhere('_files_type.id IS NULL');
            }
        }
    );

I got error in file in vendor/apy/datagrid-bundle/Grid/Grid.php at line 2053

Notice: Undefined index: from

   if (! isset($sessionFilter['to'])) { 
                $sessionFilter = $sessionFilter['from']; 
    } 

line 2052 probably should looks like :

   if (! isset($sessionFilter['to']) && isset($sessionFilter['from'])) {

please fix this BUG

Activity

  1. modified the milestone: 2.3 on Dec 13, 2015
  2. self-assigned this
    on Dec 13, 2015
  3. hmert commented on Dec 13, 2015

    @hmert
    Contributor

    @gribos If you have time, you can help and propose a PR. Or I'd like to do for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions