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.

CommentFileSizeAuthor
#2 remove-typehint.patch1.44 KBmallezie
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

    mallezie created an issue. See original summary.

    mallezie’s picture

    Status: Active » Needs review
    StatusFileSize
    new1.44 KB
    nielsaers’s picture

    Status: Needs review » Reviewed & tested by the community

    Patch resolves the issue. Haven't seen any side effects.

    • mallezie authored ee24ace3 on 2.0.x
      Issue #3321663 by mallezie: Context is not an array when passed from...
    mheip’s picture

    Status: Reviewed & tested by the community » Fixed

    Committed!

    mallezie’s picture

    Thanks!

    mheip’s picture

    Credited the ones who worked on it!

    Status: Fixed » Closed (fixed)

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