Problem/Motivation

Unable to install custom distro using Drush
TypeError: _scheduler_config_import_process_entity_definitions(): Argument #1 ($context) must be of type array, DrushBatchContext given, called in /var/www/html/docroot/core/lib/Drupal/Core/Config/ConfigImporter.php on line 565 in _scheduler_config_import_process_entity_definitions() (line 1447 of /var/www/html/docroot/modules/contrib/scheduler/scheduler.module).

Steps to reproduce

Using custom distro but will test with others.

Proposed resolution

Remove the array type hint from _scheduler_config_import_process_entity_definitions.

Remaining tasks

User interface changes

API changes

Data model changes

Issue fork scheduler-3373725

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

kevinfunk created an issue. See original summary.

vishalkhode’s picture

We are also seeing the same issue and can confirm the MR !93 fixes the issue.

vishalkhode’s picture

Status: Active » Reviewed & tested by the community
jonathan1055’s picture

Thanks @kevinfunk for reporting this. I presume you are using the newly released 2.0.0
This function was added in #3336108: Don't run hook_modules_installed during config install - the last commit to be made before releasing.

jonathan1055’s picture

Looking for hook_config_import_steps_alter in Core D9, the only example I could find was in field.module where $context is defined as an array. The core.api.php example also defines it as a plain array.

So maybe Drush is doing something a bit different? What Drush version are you using?

kevinfunk’s picture

@jonathan1055 I am using Drush 11.6.0.
The example for function hook_config_import_steps_alter does not show a type hint for $context. I think it has to do with it being a batch. I also found an issue for Queue UI where they had an issue with the type hint #3313894.

jonathan1055’s picture

You are right that the core.api.php does not have the array type hint, but in the comments it says: "The callable should accept a $context array by reference." Maybe that is where the confusion started. Thanks for linking the other issue. That one also had #3306333: Support calling the QueueUiBatch service from Drush for background.

jonathan1055’s picture

Status: Reviewed & tested by the community » Fixed

Fixed. Thank you again for reporting this and for providing the merge request.

chandu7929’s picture

Hi @ jonathan1055 when can we expect this to be released? This is breaking our site installation.

jonathan1055’s picture

jonathan1055’s picture

I have released Scheduler 2.0.1 which contains this fix.

Status: Fixed » Closed (fixed)

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