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

Commit

Permalink
Merge pull request #101 from cultuurnet/revert-94-feature/WKS-264
Browse files Browse the repository at this point in the history
Revert "WKS-264: undo revert WKS-260 + add check on searching."
  • Loading branch information
svenhoutmeyers authored Aug 16, 2016
2 parents 994f05b + 16a5d44 commit bed262e
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 41 deletions.
8 changes: 3 additions & 5 deletions culturefeed_agenda/includes/blocks.inc
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ function culturefeed_agenda_search_block_form($form, &$form_state) {

$form = array();

// Always submit to front, so that searches on a 404 would work.
// $form['#action'] = url('<front>');

// Category search.
if (isset($active_fields['types'])) {

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

$form['searching'] = array(
'#type' => 'hidden',
'#value' => TRUE,
);

global $user;
if ($user->uid) {
$form['#token'] = FALSE;
Expand Down
6 changes: 0 additions & 6 deletions culturefeed_agenda/lib/Drupal/AgendaSearchPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,6 @@ public function initialize() {
if (empty($this->facetComponent)) {
$this->facetComponent = new Facet\FacetComponent();

// If a search form was submitted, immediately return to avoid unnecessary calls to search api.
if (!empty($_POST['searching'])) {
$this->result = new \CultuurNet\Search\SearchResult();
return;
}

// Retrieve search parameters and add some defaults.
$params = drupal_get_query_parameters();
$params += array(
Expand Down
22 changes: 1 addition & 21 deletions culturefeed_search_ui/includes/blocks.inc
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,6 @@ function culturefeed_search_ui_search_block_form($form, & $form_state) {
'#value' => t('Search'),
);

$form['searching'] = array(
'#type' => 'hidden',
'#value' => TRUE,
);

$form_state['searchable_types'] = $searchable_types;

global $user;
Expand Down Expand Up @@ -309,7 +304,7 @@ function culturefeed_search_ui_block_city_facet() {
}

$noresults = FALSE;
if (!isset($_POST['searching']) && $culturefeedSearchResult->getTotalCount() == 0) {
if ($culturefeedSearchResult->getTotalCount() == 0) {
$noresults = TRUE;
// Hide location selector for empty results only when no location was set.
if (empty($location)) {
Expand Down Expand Up @@ -392,11 +387,6 @@ function culturefeed_search_ui_city_facet_form() {
),
);

$form['searching'] = array(
'#type' => 'hidden',
'#value' => TRUE,
);

$form['submit'] = array(
'#type' => 'submit',
'#value' => t('Ok'),
Expand Down Expand Up @@ -622,11 +612,6 @@ function culturefeed_search_ui_city_only_facet_form() {
'#attributes' => array('placeholder' => t('Zipcode or city')),
);

$form['searching'] = array(
'#type' => 'hidden',
'#value' => TRUE,
);

$form['submit'] = array(
'#type' => 'submit',
'#value' => t('Ok'),
Expand Down Expand Up @@ -878,11 +863,6 @@ function culturefeed_search_ui_block_location_search_form($form, $form_state) {
'#attributes' => array('class' => array('location-search', 'jquery-ui-autocomplete'), 'placeholder' => t('Zipcode or city')),
);

$form['searching'] = array(
'#type' => 'hidden',
'#value' => TRUE,
);

$form['submit'] = array(
'#type' => 'submit',
'#value' => t('Ok'),
Expand Down
6 changes: 3 additions & 3 deletions culturefeed_search_ui/includes/pages.inc
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ use \Guzzle\Http\Exception;
*/
function culturefeed_search_ui_search_page($name, $class_name = NULL, $request_type = 'nojs') {

// If a search form was submitted, immediately return to avoid unnecessary calls to search api.
if (!empty($_POST['searching'])) {
// The first search page callback is a dummy callback to redirect to the
// real search page.
if ($name == "submitted") {
return "";
}

$ajax = $request_type == 'ajax';
$rss = $request_type == 'rss';

Expand Down
6 changes: 0 additions & 6 deletions culturefeed_search_ui/lib/Drupal/CultureFeedSearchPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -338,12 +338,6 @@ public function initialize() {
if (empty($this->facetComponent)) {
$this->facetComponent = new FacetComponent();

// If a search form was submitted, immediately return to avoid unnecessary calls to search api.
if (!empty($_POST['searching'])) {
$this->result = new \CultuurNet\Search\SearchResult();
return;
}

// Retrieve search parameters and add some defaults.
$params = drupal_get_query_parameters();
$params += array(
Expand Down

0 comments on commit bed262e

Please sign in to comment.