Monday, August 26, 2013

Drupal error Notice: Undefined index: name in system_requirements() (line 39

drupal has these random errors which like shitty M$ winblows keeps the user clueless on how to fix the error.

/admin/config
Notice: Undefined index: name in system_requirements() (line 40 of /var/www/core/modules/system/system.install).
https://drupal.org/node/420358 useless discussion and no solutions

Notice: Undefined index: name in system_requirements() (line 39 of /home/xxxx/public_html/xxxx/modules/system/system.install).
Notice: Undefined index: version in system_requirements() (line 41 of /home/xxxx/public_html/xxxxx/modules/system/system.install).

http://www.drupaldeveloper.es/en/notice-undefined-index-name-in-system-requirements-linea-39-y-41
^^ best solution

Solution of these errors.
Open file in modules/system/system.install
Find lines 39 and 41.
Change following part of code.


  // Display the currently active install profile, if the site
  // is not running the default install profile.
  $profile = drupal_get_profile();
  if ($profile != 'standard') {
    $info = system_get_info('module', $profile);
    $requirements['install_profile'] = array(
      'title' => $t('Install profile'),
      'value' => $t('%profile_name (%profile-%version)', array(
        '%profile_name' => $info['name'],
        '%profile' => $profile,
        '%version' => $info['version']
      )),
      'severity' => REQUIREMENT_INFO,
      'weight' => -9
    );
  }
}
Change to:

  // Display the currently active install profile, if the site is not running
  // the default install profile and the profile is enabled.
  $profile = drupal_get_profile();
  if ($profile != 'standard') {
  $modules = module_list();
    if (isset($modules[$profile])) {
      $info = system_get_info('module', $profile);
      $requirements['install_profile'] = array(
        'title' => $t('Install profile'),
        'value' => $t('%profile_name (%profile)', array(
          '%profile_name' => $info['name'],
          '%profile' => $profile,
        )),
        'severity' => REQUIREMENT_INFO,
        'weight' => -9
      );
    }
  }
}

No comments:

Post a Comment