Closed (fixed)
Project:
Scheduler
Version:
2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
10 Jul 2023 at 20:16 UTC
Updated:
28 Jul 2023 at 12:29 UTC
Jump to comment: Most recent
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).
Using custom distro but will test with others.
Remove the array type hint from _scheduler_config_import_process_entity_definitions.
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
Comment #3
vishalkhode commentedWe are also seeing the same issue and can confirm the MR !93 fixes the issue.
Comment #4
vishalkhode commentedComment #5
jonathan1055 commentedThanks @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.
Comment #6
jonathan1055 commentedLooking for
hook_config_import_steps_alterin 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?
Comment #7
kevinfunk@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.Comment #8
jonathan1055 commentedYou 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.
Comment #10
jonathan1055 commentedFixed. Thank you again for reporting this and for providing the merge request.
Comment #11
chandu7929 commentedHi @ jonathan1055 when can we expect this to be released? This is breaking our site installation.
Comment #12
jonathan1055 commentedWhen #3373860: entityRevert breaks config:import if there are entity types that do not have a bundle class is done, which should be by tomorrow.
I think you can use the patch from this mr in your installation? https://git.drupalcode.org/project/scheduler/-/merge_requests/93.diff
Comment #13
jonathan1055 commentedI have released Scheduler 2.0.1 which contains this fix.