Problem/Motivation

If you create a search page and add a search box, the query is sent to Solr and the results are returned. Then the form is built. If there is an incoming $_POST in the form, i.e. the search form has been submitted then the call to drupal_get_form results in the form being processed and a redirect is issued.
Then the search results are fetched again.

Proposed resolution

Move the drupal_get_form call before the call to fetch the results.

Remaining tasks

Review

User interface changes

None

API changes

None

CommentFileSizeAuthor
apachesolr-form-redirect.patch1.15 KBlarowlan
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Nick_vh’s picture

Good catch! Let's test it and see :)

Nick_vh’s picture

Version: 7.x-1.x-dev » 6.x-3.x-dev
Status: Needs review » Patch (to be ported)

Committed! Needs backport to 6.x-3.x

Thanks for your contribution. It's very much appreciated and I hope you continue to contribute to our issue queue. We can use all the help we can get.

  • Commit 6c7106f on 7.x-1.x authored by larowlan, committed by Nick_vh:
    Issue #2288867 by larowlan: Fixed Search results built twice when using...

mkalkbrenner’s picture

Status: Patch (to be ported) » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

Status: Closed (fixed) » Needs review
Nemanja’s picture

Found that retain current filter doesn't work because it's being build after form

mkalkbrenner’s picture

Which version? 6.x or 7.x or both?
Does it work if you simply apply the reverse patch?

Nemanja’s picture

I found it on D7, i submitted patch on https://www.drupal.org/node/2343001

mkalkbrenner’s picture

Status: Needs review » Closed (fixed)

I close this issue again. Let's continue the discussion on #2343001: Retain filters checkbox is missing.