Watchdog live doesn't work without Clean URLs

careernerd - March 20, 2008 - 23:46
Project:Watchdog Live
Version:5.x-1.1
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Description

This can be fixed like so:

//Line 39 of watchdog.module
//Before:
drupal_add_js(array('watchdogLive' => array('basePath' => base_path())), 'setting');

//After:
drupal_add_js(array('watchdogLive' => array('basePath' => url('admin/logs/watchdog/live/callback'))), 'setting');

url() includes the base_path() and handles whether clean urls are enabled or not. Its also probably best to have the path code in PHP, not JS.

//Line 28 of watchdog_live.js
//Before:
$.get(Drupal.settings.watchdogLive.basePath +'admin/logs/watchdog/live/callback', function(data) {

//After:
$.get(Drupal.settings.watchdogLive.basePath, function(data) {

Tested in 5.7, with drupal in both a subfolder and not.

#1

Steve McKenzie - March 20, 2008 - 23:48
Status:needs review» active

ya that looks cool.

can you submit a patch?

 
 

Drupal is a registered trademark of Dries Buytaert.