Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 295557

Drupal crashes after clearing caches and after enabling new module

$
0
0

Problem/Motivation

After update to Drupal 7.87 to 7.88, Drupal crashes after clearing cashes at:

/admin/config/development/performance" and clicking "Clear all caches"

and crashes after enabling a newly installed module at:

/admin/modules and clicking "Save configuration"

The following message is displayed: Error: The website encountered an unexpected error. Please try again later.

Steps to reproduce

1. Update from Drupal 7.87 to 7.88

2. Go to /admin/config/development/performance and click "Clear all caches" or go to /admin/modules and check mark to enable on a module and click "Save configuration"

3. The following errors display:

Notice: Trying to access array offset on value of type bool in /home/mysite/www/www/mytestingsite/includes/common.inc on line 7340
Warning: Invalid argument supplied for foreach() in /home/mysite/www/www/mytestingsite/includes/common.inc on line 7340
Notice: Trying to access array offset on value of type bool in /home/mysite/www/www/mytestingsite//includes/common.inc on line 7360
Warning: array_keys() expects parameter 1 to be array, null given in /home/mysite/www/www/mytestingsite/includes/common.inc on line 7360

4. All pages then display only: "Error: The website encountered an unexpected error. Please try again later."

5. If I type in a URL for a page that doesn't exist (ex: http://mysite/fake-page) forcing the Drupal to take me to "Page Not Found" the error goes away and the site appears normal again. Also, Drupal had gone ahead and enabled the module or cleared the caches.

6. Lines 7340 and 7360 refer to this section in common.inc

/**
 * Retrieves the type for every field in a table schema.
 *
 * @param $table
 *   The name of the table from which to retrieve type information.
 *
 * @return
 *   An array of types, keyed by field name.
 */
function drupal_schema_field_types($table) {
  $table_schema = drupal_get_schema($table);
  $field_types = array();
  foreach ($table_schema['fields'] as $field_name => $field_info) {
    $field_types[$field_name] = isset($field_info['type']) ? $field_info['type'] : NULL;
  }
  return $field_types;
}

/**
 * Retrieves a list of fields from a table schema.
 *
 * The returned list is suitable for use in an SQL query.
 *
 * @param $table
 *   The name of the table from which to retrieve fields.
 * @param
 *   An optional prefix to to all fields.
 *
 * @return An array of fields.
 */
function drupal_schema_fields_sql($table, $prefix = NULL) {
  $schema = drupal_get_schema($table);
  $fields = array_keys($schema['fields']);
  if ($prefix) {
    $columns = array();
    foreach ($fields as $field) {
      $columns[] = "$prefix.$field";
    }
    return $columns;
  }
  else {
    return $fields;
  }
}

Proposed resolution

I am not a developer and don't understand the root cause of this error. Be kind, please.


Viewing all articles
Browse latest Browse all 295557