Context is not an array when passed from drush

Created on 15 November 2022, over 1 year ago
Updated 9 March 2023, over 1 year ago

Problem/Motivation

When importing config in drush $context in batched operations is not always an array, although it is typehinted this way.
On php 8.1 this gives an error.

Steps to reproduce

Run config import on site with entity type behaviors enabled.

In ProcessBase.php line 171:
                                                                                                                                                                                                                              
  Unable to decode output into JSON: Syntax error                                                                                                                                                                             
                                                                                                                                                                                                                              
  TypeError: entity_type_behaviors_update_behavior_entity_types(): Argument #1 ($context) must be of type array, DrushBatchContext given in entity_type_behaviors_update_behavior_entity_types() (line 167 of /var/www/html/  
  docroot/modules/contrib/entity_type_behaviors/entity_type_behaviors.module).      

Proposed resolution

Remove the typehints.

πŸ› Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

πŸ‡§πŸ‡ͺBelgium mallezie Loenhout

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024