Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
wouterj committed May 1, 2016
1 parent 813d987 commit c7633c2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions Datagrid/Datagrid.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,15 +126,15 @@ public function buildPager()
$this->formBuilder->add($filter->getFormName(), $type, $options);
}

$this->formBuilder->add('_sort_by', 'Symfony\Component\Form\Extension\Core\Type\HiddenType');
$this->formBuilder->add('_sort_by', 'hidden');
$this->formBuilder->get('_sort_by')->addViewTransformer(new CallbackTransformer(
function ($value) { return $value; },
function ($value) { return $value instanceof FieldDescriptionInterface ? $value->getName() : $value; }
));

$this->formBuilder->add('_sort_order', 'Symfony\Component\Form\Extension\Core\Type\HiddenType');
$this->formBuilder->add('_page', 'Symfony\Component\Form\Extension\Core\Type\HiddenType');
$this->formBuilder->add('_per_page', 'Symfony\Component\Form\Extension\Core\Type\HiddenType');
$this->formBuilder->add('_sort_order', 'hidden');
$this->formBuilder->add('_page', 'hidden');
$this->formBuilder->add('_per_page', 'hidden');

$this->form = $this->formBuilder->getForm();
$this->form->submit($this->values);
Expand Down
2 changes: 1 addition & 1 deletion Filter/Filter.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public function setOption($name, $value)
*/
public function getFieldType()
{
return $this->getOption('field_type', 'Symfony\Component\Form\Extension\Core\Type\TextType');
return $this->getOption('field_type', 'text');
}

/**
Expand Down

0 comments on commit c7633c2

Please sign in to comment.