Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
On my localhost, OS X 10.11 with PHP56 and MYSQL 5.6.21 (lower_case_table_names = 2), on page /admin/structure/demo/dump, I have the notices:
Notice: Undefined index: actions in demo_enum_tables() (line 628 of /Users/alexandre/Sites/drupal/sites/all/modules/contrib/demo/demo.admin.inc).
Notice: Undefined index: authmap in demo_enum_tables() (line 628 of /Users/alexandre/Sites/drupal/sites/all/modules/contrib/demo/demo.admin.inc).
...
and more, after create the snapshot (back to .admin/structure/demo):
Notice: Undefined index: watchdog in demo_enum_tables() (line 628 of /Users/alexandre/Sites/drupal/sites/all/modules/contrib/demo/demo.admin.inc).
Notice: Undefined index: comment in _demo_table_is_view() (line 335 of /Users/alexandre/Sites/drupal/sites/all/modules/contrib/demo/database_mysql_dump.inc).
...
I solve with this patch:
diff --git a/sites/all/modules/contrib/demo/database_mysql_dump.inc b/sites/all/modules/contrib/demo/database_mysql_dump.inc
index 1d3eb7c..99e1ca4 100644
--- a/sites/all/modules/contrib/demo/database_mysql_dump.inc
+++ b/sites/all/modules/contrib/demo/database_mysql_dump.inc
@@ -132,7 +132,7 @@
$output .= preg_replace(
array('/^CREATE TABLE/', '/"/'),
array('CREATE TABLE IF NOT EXISTS', '`'),
- $data['create table']
+ $data['Create Table']
);
// @todo Rethink the following code. Perhaps try to strip + parse the existing
@@ -332,7 +332,7 @@
static $tables = array();
if (!isset($tables[$table])) {
$status = db_query('SHOW TABLE STATUS LIKE :table', array(':table' => $table))->fetchAssoc();
- $tables[$table] = (strtoupper(substr($status['comment'], 0, 4)) == 'VIEW');
+ $tables[$table] = (strtoupper(substr($status['Comment'], 0, 4)) == 'VIEW');
}
return $tables[$table];
}
diff --git a/sites/all/modules/contrib/demo/demo.admin.inc b/sites/all/modules/contrib/demo/demo.admin.inc
index 1d40fc3..ae6562a 100644
--- a/sites/all/modules/contrib/demo/demo.admin.inc
+++ b/sites/all/modules/contrib/demo/demo.admin.inc
@@ -625,7 +625,7 @@
if (preg_match($rx, $table, $matches)) {
$table_prefix = $matches[0];
$plain_table = substr($table, strlen($table_prefix));
- if ($prefixes[$plain_table] == $table_prefix || $prefixes['default'] == $table_prefix) {
+ if ( (array_key_exists($plain_table, $prefixes) && $prefixes[$plain_table] == $table_prefix) || $prefixes['default'] == $table_prefix ) {
$tables[$table] = array('schema' => TRUE, 'data' => TRUE);
}
}
Cheers.
Comment | File | Size | Author |
---|---|---|---|
demo.patch | 1.64 KB | alsantos123 | |
Screen Shot 2015-08-02 at 01.40.47.png | 390.34 KB | alsantos123 | |
Screen Shot 2015-08-02 at 01.36.33.png | 527.35 KB | alsantos123 |
Comments
Comment #1
gaurav.kapoor CreditAttribution: gaurav.kapoor at OpenSense Labs commentedWill review your patch in a while.
Comment #2
gaurav.kapoor CreditAttribution: gaurav.kapoor at OpenSense Labs commentedNot picking entire changes suggested in the patch. The issue has been resolved due to some other commits. Marking as fixed. Please reopen if you have still faced this problem.