Skip to content

Commit

Permalink
Merge branch '1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
kmadejski committed Oct 29, 2020
2 parents 4a40299 + 77f53bf commit a9d2574
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/bundle/Form/Type/SearchType.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function buildForm(FormBuilderInterface $builder, array $options)
->add('query', CoreSearchType::class, ['required' => false])
->add('page', HiddenType::class, ['empty_data' => 1])
->add('limit', HiddenType::class, [
'empty_data' => $this->configResolver->getParameter('pagination.search_limit'),
'empty_data' => $this->configResolver->getParameter('search.pagination.limit'),
])
->add('content_types', ContentTypeChoiceType::class, [
'multiple' => true,
Expand Down
4 changes: 2 additions & 2 deletions src/bundle/Resources/config/default_settings.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
parameters:
ezsettings.site.pagination.search_limit: 10
ezsettings.default.search.pagination.limit: 10

ezsettings.site.search_view:
ezsettings.site_group.search_view:
full:
default:
template: "@@ezdesign/search/index.html.twig"
Expand Down
2 changes: 1 addition & 1 deletion src/lib/View/SearchViewFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public function handleSearchForm(FilterViewBuilderParametersEvent $event): void
$request = $event->getRequest();

$search = $request->query->get('search');
$limit = isset($search['limit']) ? (int)$search['limit'] : $this->configResolver->getParameter('pagination.search_limit');
$limit = isset($search['limit']) ? (int)$search['limit'] : $this->configResolver->getParameter('search.pagination.limit');
$page = isset($search['page']) ? (int)$search['page'] : 1;
$query = $search['query'] ?? '';
$section = null;
Expand Down

0 comments on commit a9d2574

Please sign in to comment.