Unable to decode output into JSON: Syntax error

Created on 21 April 2023, over 1 year ago
Updated 12 May 2023, over 1 year ago

Problem/Motivation

When upgrading a Drupal 8 site to Drupal 9, and running drush updatedb, I got this error:

Unable to decode output into JSON: Syntax error                                                               
                                                                                                                
  Fatal error: Declaration of Drupal\search_api\Processor\ConfigurablePropertyBase::setConfiguration(?array $c  
  onfiguration): Drupal\search_api\Processor\ConfigurablePropertyBase must be compatible with Drupal\search_ap  
  i\Processor\ConfigurablePropertyInterface::setConfiguration(?array $configuration): Drupal\search_api\Proces  
  sor\ConfigurablePropertyInterface in /........./web/modules/contrib/search_api/src/Processor/Con  
  figurablePropertyBase.php on line 11

Proposed resolution

I was able to get the updates to run by changing:

public function setConfiguration(?array $configuration): self;

to

public function setConfiguration(?array $configuration);

Not a PHP expert (still learning as a front-ender), so no idea why this works, just figured I'd share. Not sure if the issue was with Drush, my Drupal codebase, or this module.

๐Ÿ› Bug report
Status

Fixed

Version

1.0

Component

Framework

Created by

๐Ÿ‡บ๐Ÿ‡ธUnited States dalemoore

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

Comments & Activities

Production build 0.71.5 2024