TypeError: Drupal\drd\Encryption::decrypt(): Argument #1 ($encrypted) must be of type array|string, null given, called in /app/web/modules/contrib/drd/modules/drd_pi/src/DrdPiAccount.php on line 100 in Drupal\drd\Encryption->decrypt() (line 128 of modules

Created on 19 September 2023, over 1 year ago
Updated 22 September 2023, about 1 year ago

Problem/Motivation

Fresh install trying to add platform account get this error:
TypeError: Drupal\drd\Encryption::decrypt(): Argument #1 ($encrypted) must be of type array|string, null given, called in /app/web/modules/contrib/drd/modules/drd_pi/src/DrdPiAccount.php on line 100 in Drupal\drd\Encryption->decrypt() (line 128 of modules/contrib/drd/src/Encryption.php).

Proposed resolution

It seems its trying to decrypt when there are no accounts so I add this and it worked:

protected function getDecrypted(string $key): ?string {
$value = $this->get($key);
if (empty($value)) {
return NULL;
}

\Drupal::service('drd.encrypt')->decrypt($value);
return $value;
}

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Fixed

Version

4.1

Component

Code

Created by

🇬🇧United Kingdom zarexogre

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

Comments & Activities

Production build 0.71.5 2024