Hi, when I use this module in Firefox, I go to a page like /search/node/Query?page=1

But Drupal's search pages start with 0. The problem is, if you have 5 results and set page=1, then you will see a "no results" page, because there are no results > 10 (page 2).

I get the impression that the browser sets the default page = 1. How can we fix this?

Comments

Anonymous’s picture

Status: Active » Postponed (maintainer needs more info)

I am not sure you are referring to the result provided from the module, or from the search module.

You are referring to /search/node/Query?page=1, which is the relative path used by search.module.

Anonymous’s picture

Hi Kiam,

after you add the opensearch provider to firefox, you can search the drupal site using the browser's top right box (in my case).

This box submits to /search/node/Query?page=1 (which is Page 2 in Drupal)

So I think the browser adds this "1". I removed the page={startPage}, so it submits to /search/node/Query, without a "page=1". Seems unecessary.

So change:

url('search/' . $info->type . '/{searchTerms}', array('query' => 'page={startPage}', 'absolute' => TRUE))

to:

url('search/' . $info->type . '/{searchTerms}', array('absolute' => TRUE))

It think that is the way to do it. I don't see why the browser-search should set the page=x.

Anonymous’s picture

It think that is the way to do it. I don't see why the browser-search should set the page=x.

That is necessary for the other pages. A search could return more than one page of results; without that parameter, you would always see the first page.

Anonymous’s picture

Title: startPage = 1? Drupal starts with 0 » Don't use startPage
Status: Postponed (maintainer needs more info) » Fixed

I got it; if startPage is used, the search engine will always ask for page #1, which is the second results page for Drupal.
I removed the parameter startPage, even if I could have used page={startPage?}, which would have made that parameter optional. I noticed that Firefox doesn't pass such parameter for any of the search engines it currently defines (including Wikipedia, that is added to Firefox through an Opensearch description file returned from wikipedia.org).

I changed the code, and committed it. Thanks for your report, and help.

Status: Fixed » Closed (fixed)

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