Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jamsilver’s picture

Assigned: jamsilver » Unassigned
Status: Needs work » Needs review
FileSize
8.62 KB

Patch attached.

jamsilver’s picture

Issue summary: View changes

Added features:

  • Choosing a drupal path of 'search' now overrides core search module's path cleanly
jamsilver’s picture

FileSize
9.04 KB
iamEAP’s picture

Thanks @jamsilver. This is definitely a common requirement that I'd like to support. I haven't found any issues in reviewing the patch; I'll test in simplytest.me and on our existing installation before committing.

Thanks for your contribution!

iamEAP’s picture

Status: Needs review » Needs work

One thing that did come up in testing is that if you have both Core search and GSA enabled (and responding at /search), people will no longer be able to search for "node" or "user" because /search/node and /search/user correspond to core search callbacks.

I think that's a use-case we can call "unsupported," as long as we note it in the documentation / README.txt. While we're in there, we should update the README to reflect this new feature.

iaminawe’s picture

I found this worked great if my path was just /search or just /internal but broken when I set it to /search/internal which is what I needed.

I submit a small addition to the above patch that will work for if you need to have two levels above the actual keyword being searched in the url.

iamEAP’s picture

That actually brings up a very good point. Rather than hardcoding it, as suggest by @iaminawe in #6...

+++ b/google_appliance.module
@@ -97,7 +97,7 @@ function google_appliance_menu() {
   // search results page
-  $items['gsearch'] = array(
+  $items[$settings['drupal_path']] = array(
     'title' => $settings['search_title'],
     'page callback' => 'google_appliance_search_view',
     'page arguments' => array(1, 2), // (1) search query, (2) results sort param

We should adjust the page arguments based on the depth provided by the "drupal_path" variable. Should be pretty straightforward.

This is in addition to adding/adjusting details in the README.txt (#5).

iaminawe’s picture

Yes that makes more sense than hardcoding it iamEAP. Thanks

iamEAP’s picture

Here's a re-roll of #3 against the latest codebase. Still need to add/update documentation and account for the page arguments (#7).

iamEAP’s picture

Status: Needs work » Needs review
FileSize
11.79 KB
3.58 KB

Aaand here's #9 with the dynamic menu arguments and documentation changes. Interdiff for the highlights.

@iaminawe or @jamsilver, would you mind testing and reviewing?

JuliaKoelsch’s picture

Status: Needs review » Reviewed & tested by the community

We have applied this patch successfully, and it works great. Thank you!

timwood’s picture

Version: 7.x-1.11 » 7.x-1.13
FileSize
11.69 KB

Rerolled patch file for version 7.x-1.13. Should probably be done for -dev, but this is what I was able to do for now.

  • iamEAP committed 8b0dd0a on 7.x-1.x
    Issue #2219513 by iamEAP, jamsilver, iaminawe, timwood: Allow a...
iamEAP’s picture

Status: Reviewed & tested by the community » Fixed

Thanks all! Looks good and committed to 7.x-1.x-dev.

Status: Fixed » Closed (fixed)

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