Problem/Motivation

When the Drupal site is nested in a directory (example.com/drupal), the search feature does not work. This is because it is always requesting for "/admin/admin-toolbar-search". This means for a site on example.com/drupal, the search will request at example.com/admin/admin-toolbar-search. But, what it needs to request is example.com/drupal/admin/admin-toolbar-search.

Proposed resolution

In admin_toolbar/admin_toolbar_search/js/admin_toolbar_search.js, replace the $.getJSON line with the following:

$.getJSON(Drupal.url("admin/admin-toolbar-search"), function( data ) {

The Drupal.url() function will return the proper url for the site regardless of the root level of the domain.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

bobbysaul created an issue. See original summary.

bobbysaul’s picture

Title: Search on subdomains » Search on non root domains
Status: Active » Needs review
FileSize
766 bytes

Here is my patch.

bobbysaul’s picture

Re-uploading to put space in js parameters

adriancid’s picture

Status: Needs review » Fixed

Thanks

  • adriancid committed 04680d5 on 8.x-2.x authored by bobbysaul
    Issue #3173026 by bobbysaul, adriancid: Search on non root domains
    

Status: Fixed » Closed (fixed)

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