Commit 4e05f2ae authored by Steffen Schüssler's avatar Steffen Schüssler
Browse files

fix empty table - Fixes #3285097 update hook to support units on width/height

parent 8fabb319
Loading
Loading
Loading
Loading
+13 −1
Original line number Diff line number Diff line
@@ -178,9 +178,21 @@ class FieldTypeUpdateUtil {
  
        // Restore the data.
        foreach ($tables as $table) {
          if (
            !isset($existing_data[$table])
            || !is_array($existing_data[$table])
            || !count($existing_data[$table])
          ) {
            continue;
          }
          $last_row = end($existing_data[$table]);
          if ($last_row == false) {
            continue;
          }
          $fields = array_keys($last_row);
          $insert_query = $database
            ->insert($table)
            ->fields(array_keys(end($existing_data[$table])));
            ->fields($fields);
          foreach ($existing_data[$table] as $row) {
            $insert_query->values(array_values($row));
          }