Bug in the watchdog module if Drupal runs through a subdirectory, and has clean URLs disabled.

On submitting an event, say a Blog entry or a page, etc, the watchdog module generates the event in the log, which apart from the view link also has a 'details' link. Clicking on the latter takes you to a new page which has an HTML table, with a Location on it.

The location in this case is of the type ?q=something. What this bug is doing is, that the database entry for the watchdog table is being appended with the subdir name also. What this means is, if the site runs as http://localhost/drupal, the entry should point to http://localhost/drupal/?q=xyz.

It presently points to http://localhost/drupal/?q=/drupal/?q=xyz. Which is an error.

---------
The problem as I can see it is in bootstrap.inc, which on line 737 has:

function watchdog($type, $message, $severity = WATCHDOG_NOTICE, $link = NULL) {
  global $user;

  db_query("INSERT INTO {watchdog} (uid, type, message, severity, link, location, hostname, timestamp) VALUES (%d, '%s', '%s', %d, '%s', '%s', '%s', %d)", $user->uid, $type, $message, $severity, $link, request_uri() , $_SERVER['REMOTE_ADDR'], time());
}

The request_uri() function needs to be changed to accomodate this.
I'd like a bit of help as to how this can be dealt with.

Thanks,
Viksit

CommentFileSizeAuthor
drupal_bug.png124.36 KBviksit
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

killes@www.drop.org’s picture

viksit’s picture

Ah, I was searching specifically for 'watchdog' in my search for duplicates.
Cheers,