diff options
-rw-r--r-- | database/updates.inc | 7 | ||||
-rw-r--r-- | modules/statistics.module | 3 | ||||
-rw-r--r-- | modules/statistics/statistics.module | 3 |
3 files changed, 7 insertions, 6 deletions
diff --git a/database/updates.inc b/database/updates.inc index ae2932d94..8dab69b03 100644 --- a/database/updates.inc +++ b/database/updates.inc @@ -1307,9 +1307,12 @@ function update_95() { function update_96() { $ret = array(); - $ret[] = update_sql('ALTER TABLE {accesslog} DROP nid'); - $ret[] = update_sql('ALTER TABLE {accesslog} ADD title VARCHAR(255) DEFAULT NULL'); $ret[] = update_sql('ALTER TABLE {accesslog} ADD path VARCHAR(255) DEFAULT NULL'); + $ret[] = update_sql('UPDATE {accesslog} SET path = CONCAT("node/", nid) WHERE nid != 0'); + $ret[] = update_sql('ALTER TABLE {accesslog} ADD title VARCHAR(255) DEFAULT NULL'); + /* Only supported by MySQL 4.0.4 and up + $ret[] = update_sql('UPDATE {accesslog} a, {node} n SET a.title = n.title WHERE a.nid = n.nid');*/ + $ret[] = update_sql('ALTER TABLE {accesslog} DROP nid'); if ($GLOBALS['db_type'] == 'mysql') { $ret[] = update_sql("ALTER TABLE {menu} ADD description varchar(255) DEFAULT '' NOT NULL"); diff --git a/modules/statistics.module b/modules/statistics.module index a334ee669..e33b56a45 100644 --- a/modules/statistics.module +++ b/modules/statistics.module @@ -74,10 +74,9 @@ function statistics_exit() { // Statistical logs are enabled. $referrer = referer_uri(); $hostname = $_SERVER['REMOTE_ADDR']; - $path = (drupal_get_path_alias($_GET['q'])) ? drupal_get_path_alias($_GET['q']) : $_GET['q']; // Log this page access. - db_query("INSERT INTO {accesslog} (title, path, url, hostname, uid, timestamp) values('%s', '%s', '%s', '%s', %d, %d)", drupal_get_title(), $path, $referrer, $hostname, $user->uid, time()); + db_query("INSERT INTO {accesslog} (title, path, url, hostname, uid, timestamp) values('%s', '%s', '%s', '%s', %d, %d)", drupal_get_title(), $_GET['q'], $referrer, $hostname, $user->uid, time()); } } diff --git a/modules/statistics/statistics.module b/modules/statistics/statistics.module index a334ee669..e33b56a45 100644 --- a/modules/statistics/statistics.module +++ b/modules/statistics/statistics.module @@ -74,10 +74,9 @@ function statistics_exit() { // Statistical logs are enabled. $referrer = referer_uri(); $hostname = $_SERVER['REMOTE_ADDR']; - $path = (drupal_get_path_alias($_GET['q'])) ? drupal_get_path_alias($_GET['q']) : $_GET['q']; // Log this page access. - db_query("INSERT INTO {accesslog} (title, path, url, hostname, uid, timestamp) values('%s', '%s', '%s', '%s', %d, %d)", drupal_get_title(), $path, $referrer, $hostname, $user->uid, time()); + db_query("INSERT INTO {accesslog} (title, path, url, hostname, uid, timestamp) values('%s', '%s', '%s', '%s', %d, %d)", drupal_get_title(), $_GET['q'], $referrer, $hostname, $user->uid, time()); } } |