Skip to content
This repository was archived by the owner on Jan 15, 2021. It is now read-only.

Commit bed262e

Browse files
Merge pull request #101 from cultuurnet/revert-94-feature/WKS-264
Revert "WKS-264: undo revert WKS-260 + add check on searching."
2 parents 994f05b + 16a5d44 commit bed262e

File tree

5 files changed

+7
-41
lines changed

5 files changed

+7
-41
lines changed

culturefeed_agenda/includes/blocks.inc

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,9 @@ function culturefeed_agenda_search_block_form($form, &$form_state) {
9898

9999
$form = array();
100100

101+
// Always submit to front, so that searches on a 404 would work.
102+
// $form['#action'] = url('<front>');
103+
101104
// Category search.
102105
if (isset($active_fields['types'])) {
103106

@@ -219,11 +222,6 @@ function culturefeed_agenda_search_block_form($form, &$form_state) {
219222
'#weight' => 200,
220223
);
221224

222-
$form['searching'] = array(
223-
'#type' => 'hidden',
224-
'#value' => TRUE,
225-
);
226-
227225
global $user;
228226
if ($user->uid) {
229227
$form['#token'] = FALSE;

culturefeed_agenda/lib/Drupal/AgendaSearchPage.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,6 @@ public function initialize() {
2222
if (empty($this->facetComponent)) {
2323
$this->facetComponent = new Facet\FacetComponent();
2424

25-
// If a search form was submitted, immediately return to avoid unnecessary calls to search api.
26-
if (!empty($_POST['searching'])) {
27-
$this->result = new \CultuurNet\Search\SearchResult();
28-
return;
29-
}
30-
3125
// Retrieve search parameters and add some defaults.
3226
$params = drupal_get_query_parameters();
3327
$params += array(

culturefeed_search_ui/includes/blocks.inc

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,6 @@ function culturefeed_search_ui_search_block_form($form, & $form_state) {
4141
'#value' => t('Search'),
4242
);
4343

44-
$form['searching'] = array(
45-
'#type' => 'hidden',
46-
'#value' => TRUE,
47-
);
48-
4944
$form_state['searchable_types'] = $searchable_types;
5045

5146
global $user;
@@ -309,7 +304,7 @@ function culturefeed_search_ui_block_city_facet() {
309304
}
310305

311306
$noresults = FALSE;
312-
if (!isset($_POST['searching']) && $culturefeedSearchResult->getTotalCount() == 0) {
307+
if ($culturefeedSearchResult->getTotalCount() == 0) {
313308
$noresults = TRUE;
314309
// Hide location selector for empty results only when no location was set.
315310
if (empty($location)) {
@@ -392,11 +387,6 @@ function culturefeed_search_ui_city_facet_form() {
392387
),
393388
);
394389

395-
$form['searching'] = array(
396-
'#type' => 'hidden',
397-
'#value' => TRUE,
398-
);
399-
400390
$form['submit'] = array(
401391
'#type' => 'submit',
402392
'#value' => t('Ok'),
@@ -622,11 +612,6 @@ function culturefeed_search_ui_city_only_facet_form() {
622612
'#attributes' => array('placeholder' => t('Zipcode or city')),
623613
);
624614

625-
$form['searching'] = array(
626-
'#type' => 'hidden',
627-
'#value' => TRUE,
628-
);
629-
630615
$form['submit'] = array(
631616
'#type' => 'submit',
632617
'#value' => t('Ok'),
@@ -878,11 +863,6 @@ function culturefeed_search_ui_block_location_search_form($form, $form_state) {
878863
'#attributes' => array('class' => array('location-search', 'jquery-ui-autocomplete'), 'placeholder' => t('Zipcode or city')),
879864
);
880865

881-
$form['searching'] = array(
882-
'#type' => 'hidden',
883-
'#value' => TRUE,
884-
);
885-
886866
$form['submit'] = array(
887867
'#type' => 'submit',
888868
'#value' => t('Ok'),

culturefeed_search_ui/includes/pages.inc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ use \Guzzle\Http\Exception;
1818
*/
1919
function culturefeed_search_ui_search_page($name, $class_name = NULL, $request_type = 'nojs') {
2020

21-
// If a search form was submitted, immediately return to avoid unnecessary calls to search api.
22-
if (!empty($_POST['searching'])) {
21+
// The first search page callback is a dummy callback to redirect to the
22+
// real search page.
23+
if ($name == "submitted") {
2324
return "";
2425
}
25-
2626
$ajax = $request_type == 'ajax';
2727
$rss = $request_type == 'rss';
2828

culturefeed_search_ui/lib/Drupal/CultureFeedSearchPage.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -338,12 +338,6 @@ public function initialize() {
338338
if (empty($this->facetComponent)) {
339339
$this->facetComponent = new FacetComponent();
340340

341-
// If a search form was submitted, immediately return to avoid unnecessary calls to search api.
342-
if (!empty($_POST['searching'])) {
343-
$this->result = new \CultuurNet\Search\SearchResult();
344-
return;
345-
}
346-
347341
// Retrieve search parameters and add some defaults.
348342
$params = drupal_get_query_parameters();
349343
$params += array(

0 commit comments

Comments
 (0)