Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#3 | non-root-domain-search-3173026-3.patch | 769 bytes | bobbysaul |
|
Comments
Comment #2
bobbysaul CreditAttribution: bobbysaul commentedHere is my patch.
Comment #3
bobbysaul CreditAttribution: bobbysaul commentedRe-uploading to put space in js parameters
Comment #4
adriancidThanks