Every drupal page reports :-

PHP Notice: Undefined index: path in /home/drupal/drupal/includes/bootstrap.inc on line 161

Fixed with this:-

--- bootstrap.inc.orig Fri Apr 21 07:39:00 2006
+++ bootstrap.inc Wed Apr 26 10:35:35 2006
@@ -158,7 +158,7 @@ function conf_init() {
$parts = parse_url($base_url);
$base_path = isset($parts['path']) ? $parts['path'] . '/' : '/';
// Build $base_root (everything until first slash after "scheme://").
- $base_root = substr($base_url, 0, strlen($base_url) - strlen($parts['path']));
+ $base_root = substr($base_url, 0, strlen($base_url) - strlen($base_path));
}
else {
// Create base URL

--AjK

CommentFileSizeAuthor
#3 bootstrap_19.patch816 bytesJonBob
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Tobias Maier’s picture

Status: Active » Needs review
AjK’s picture

The above patch for removing this PHP warning was incorrect.

Here is the code method:-

--- bootstrap.inc.orig  Mon May  1 14:22:21 2006
+++ bootstrap.inc       Mon May  1 14:23:27 2006
@@ -158,7 +158,7 @@ function conf_init() {
     $parts = parse_url($base_url);
     $base_path = isset($parts['path']) ? $parts['path'] . '/' : '/';
     // Build $base_root (everything until first slash after "scheme://").
-    $base_root = substr($base_url, 0, strlen($base_url) - strlen($parts['path']));
+    $base_root = @substr($base_url, 0, strlen($base_url) - strlen($parts['path']));
   }
   else {
     // Create base URL

--AjK

JonBob’s picture

FileSize
816 bytes

Here's a patch to fix the cause of the error rather than suppressing the error.

I think this is rather important to fix, as it happens before our error handler is installed, so the error may be echoed to the browser in certain configurations.

drumm’s picture

Status: Needs review » Fixed

I decided that an if statemkent was better than a ternanry operaor in this case.

Comitted to HEAD.

Anonymous’s picture

Status: Fixed » Closed (fixed)