Hi,

trying to add this module as part of a personal distribution, but this module raise an erreur, because the hook_requirements do not reteun an array.

Does this is the expected behaviour (I mean this module is maybe not supposed to be part as a distribution, since it is a kind of "dev" module) ?

By the way just adding the return of an empty array in this hook solve the problem :

/**
 * Implements hook_requirements().
 */
function upgrade_status_requirements($phase) {
  if ($phase == 'install') {
    // Check if the Drupal Finder is available. This will attempt to autoload
    // the class, so we can bail out as soon as possible.
    if (!class_exists('DrupalFinder\DrupalFinder')) {
      return [
        'upgrade_status' => [
          'description' => t('External dependencies for Upgrade Status are not available. Composer must be used to download the module with dependencies. See <a href="@url">the Upgrade Status project page</a> for instructions.', ['@url' => 'https://drupal.org/project/upgrade_status']),
          'severity' => REQUIREMENT_ERROR,
        ]
      ];
    }
    return []
  }
}

Thank you for your answer.

Regards

Comments

grumpy74 created an issue. See original summary.

grumpy74’s picture

Issue summary: View changes
Gábor Hojtsy’s picture

Title: hook_requirements do not return an array (causing issue when this module is part of profile install process) » hook_requirements does not always return an array

  • Gábor Hojtsy committed cd2a0bc on 8.x-2.x
    Issue #3149627 by grumpy74: hook_requirements does not always return an...
Gábor Hojtsy’s picture

Status: Active » Fixed

Thanks, committed!

Status: Fixed » Closed (fixed)

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