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.
The modules use a mixture of getcwd() and $_SERVER['DOCUMENT_ROOT'] to create full paths to files. I'm not sure about getcwd(), but $_SERVER['DOCUMENT_ROOT'] is not reliable. Eg, on my apache mod_vhost setup it points at /htaccess, not at the actual Drupal installation directory.
This patch defines a function that determines the document root based on the full path to the module file. Note that it applies on top of #514324: patch for SQL Fixes for postgres, missing function name, fixed forms and a stray var_dump.
Comment | File | Size | Author |
---|---|---|---|
#1 | search_files.518460.docroot_1.1.patch | 3.37 KB | cafuego |
search_files.docroot_1.0.patch | 3.37 KB | cafuego |
Comments
Comment #1
cafuego CreditAttribution: cafuego commentedSorry, I typo3d. Updated patch is attached.
Comment #2
Shiny CreditAttribution: Shiny commentedTested - works as expected in both / and when drupal is in /drupal
used apache2+postgres 8.3
Comment #3
thl CreditAttribution: thl commentedChose to use getcwd(), see #363013: Drupal 7 Breaks Symlink Use
Fixed in 6.x-2.x-dev, see search_files_attachments.module and search_files_directories.module