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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

gaurav.kapoor’s picture

Will review your patch in a while.

gaurav.kapoor’s picture

Status: Needs review » Fixed

Not 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.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.