gbif2_requirements() does not always return an array

Created on 3 December 2024, 19 days ago

Problem/Motivation

Function gbif2_requirements() in gbif2.install does not always return an array as expected by the hook implementation. This leads to an error when gbif2 module needs to be installed in a Drupal distribution:

 [error]  TypeError: array_merge(): Argument #2 must be of type array, null given in array_merge() (line 918 of /opt/drupal/web/core/includes/install.inc) #0 /opt/drupal/web/core/includes/install.inc(918): array_merge()
#1 /opt/drupal/web/core/includes/install.core.inc(2100): drupal_check_profile()
#2 /opt/drupal/web/core/includes/install.core.inc(1109): install_check_requirements()
#3 /opt/drupal/web/core/includes/install.core.inc(695): install_verify_requirements()
#4 /opt/drupal/web/core/includes/install.core.inc(572): install_run_task()
#5 /opt/drupal/web/core/includes/install.core.inc(121): install_run_tasks()
#6 /opt/drupal/vendor/drush/drush/includes/drush.inc(69): install_drupal()
#7 /opt/drupal/vendor/drush/drush/includes/drush.inc(53): drush_call_user_func_array()
#8 /opt/drupal/vendor/drush/drush/src/Commands/core/SiteInstallCommands.php(167): drush_op()
#9 [internal function]: Drush\Commands\core\SiteInstallCommands->install()
#10 /opt/drupal/vendor/consolidation/annotated-command/src/CommandProcessor.php(276): call_user_func_array()
#11 /opt/drupal/vendor/consolidation/annotated-command/src/CommandProcessor.php(212): Consolidation\AnnotatedCommand\CommandProcessor->runCommandCallback()
#12 /opt/drupal/vendor/consolidation/annotated-command/src/CommandProcessor.php(175): Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter()
#13 /opt/drupal/vendor/consolidation/annotated-command/src/AnnotatedCommand.php(387): Consolidation\AnnotatedCommand\CommandProcessor->process()
#14 /opt/drupal/vendor/symfony/console/Command/Command.php(326): Consolidation\AnnotatedCommand\AnnotatedCommand->execute()
#15 /opt/drupal/vendor/symfony/console/Application.php(1096): Symfony\Component\Console\Command\Command->run()
#16 /opt/drupal/vendor/symfony/console/Application.php(324): Symfony\Component\Console\Application->doRunCommand()
#17 /opt/drupal/vendor/symfony/console/Application.php(175): Symfony\Component\Console\Application->doRun()
#18 /opt/drupal/vendor/drush/drush/src/Runtime/Runtime.php(110): Symfony\Component\Console\Application->run()
#19 /opt/drupal/vendor/drush/drush/src/Runtime/Runtime.php(40): Drush\Runtime\Runtime->doRun()
#20 /opt/drupal/vendor/drush/drush/drush.php(139): Drush\Runtime\Runtime->run()
#21 /opt/drupal/vendor/drush/drush/drush(4): require('...')
#22 /opt/drupal/vendor/bin/drush(119): include('...')
#23 {main}.

Steps to reproduce

Create a distribution and add gbif2 as a module to install in the "install:" section of the ".info.yml".

Proposed resolution

Always return an array.

πŸ› Bug report
Status

Active

Version

2.0

Component

Code

Created by

πŸ‡«πŸ‡·France guignonv

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024