When trying to enable SimpleTest without Curl enabled, I get following error message, in addition to the nice error message telling me that I need to install curl:

# Warning: array_multisort(): Array sizes are inconsistent in system_modules_submit() (line 1222 of /var/www/drupal-7/modules/system/system.admin.inc).

I searched but couldn't find a related issue, I will test in a minute, under which circumstances this bug appears.

Comments

tstoeckler’s picture

The error disappears when you install Curl.
This is PHP Version 5.3.2-1ubuntu4 and latest HEAD (1 hour ago). And a completely fresh install.

tstoeckler’s picture

This is the relevant code in system.admin.inc:

  // Install new modules.
  if (!empty($new_modules)) {
    $sort = array();
    foreach ($new_modules as $key => $module) {
      if (!drupal_check_module($module)) {
        unset($new_modules[$key]);
      }
      $sort[$module] = $files[$module]->sort;
    }
    array_multisort($sort, SORT_DESC, $new_modules);
    module_enable($new_modules, FALSE);
  }
tstoeckler’s picture

Status: Active » Needs review
StatusFileSize
new737 bytes

This patch fixes the issue for me. Don't know if that is the correct way, though.

damien tournoud’s picture

Title: PHP error when trying to enable SimpleTest module » PHP error when a module fails requirement checks during installation
StatusFileSize
new5.18 KB

Looks like the correct fix. I implemented a basic test that enables a module that fails requirements, which triggers this error.

tstoeckler’s picture

Component: simpletest.module » system.module

Makes sense.
I was pretty sure this was a general module-installation-problem but not keen enough to change the title =).

catch’s picture

#4: 801394-php-error-requirements.patch queued for re-testing.

Status: Needs review » Needs work

The last submitted patch, 801394-php-error-requirements.patch, failed testing.

Status: Needs work » Closed (outdated)

Automatically closed because Drupal 7 security and bugfix support has ended as of 5 January 2025. If the issue verifiably applies to later versions, please reopen with details and update the version.