Skip to content
Snippets Groups Projects
Commit 7fdebc63 authored by Angie Byron's avatar Angie Byron
Browse files

#991046 by carlos8f, mikey_p: Fixed PDO Exception after upgrading from Drupal 6.19 to Drupal 7 RC1

parent 61aceff0
Branches
Tags
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -34,7 +34,7 @@ function statistics_schema() {
),
'sid' => array(
'type' => 'varchar',
'length' => 64,
'length' => 128,
'not null' => TRUE,
'default' => '',
'description' => 'Browser session ID of user that visited page.',
......@@ -141,6 +141,19 @@ function statistics_schema() {
* @{
*/
/**
* Update the {accesslog}.sid column to match the length of {sessions}.sid
*/
function statistics_update_7000() {
db_change_field('accesslog', 'sid', 'sid', array(
'type' => 'varchar',
'length' => 128,
'not null' => TRUE,
'default' => '',
'description' => 'Browser session ID of user that visited page.',
));
}
/**
* @} End of "defgroup updates-6.x-to-7.x"
* The next series of updates should start at 8000.
......
......@@ -61,6 +61,7 @@ class StatisticsLoggingTestCase extends DrupalWebTestCase {
// Ensure we have a node page to access.
$this->node = $this->drupalCreateNode();
$this->auth_user = $this->drupalCreateUser();
// Enable page caching.
variable_set('cache', TRUE);
......@@ -101,6 +102,16 @@ class StatisticsLoggingTestCase extends DrupalWebTestCase {
$this->assertEqual(array_intersect_key($log[1], $expected), $expected);
$node_counter = statistics_get($this->node->nid);
$this->assertIdentical($node_counter['totalcount'], '2');
// Test logging from authenticated users
$this->drupalLogin($this->auth_user);
$this->drupalGet($path);
$log = db_query('SELECT * FROM {accesslog}')->fetchAll(PDO::FETCH_ASSOC);
// Check the 6th item since login and account pages are also logged
$this->assertTrue(is_array($log) && count($log) == 6, t('Page request was logged.'));
$this->assertEqual(array_intersect_key($log[5], $expected), $expected);
$node_counter = statistics_get($this->node->nid);
$this->assertIdentical($node_counter['totalcount'], '3');
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment