Can't update if plugin hasn't been configured

Created on 20 December 2022, over 1 year ago
Updated 3 February 2023, over 1 year ago

Problem/Motivation

When updating from 3.0.0 to 4.0.0, oauth2_client_post_update_4_0_migrate() updates the configuration settings. It iterates over each of the plugins to get the corresponding configuration value. However, if a module defines a plugin, but it's never been configured, an error is thrown:

TypeError: Cannot assign null to property Drupal\oauth2_client\Entity\Oauth2Client::$credential_provider of type string in Drupal\Core\Config\Entity\ConfigEntityBase->set() (line 169 of /var/www/web/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php).

Proposed resolution

If there are no credentials to update, skip.

    if (empty($credentialSettings)) {
      // This plugin has no configuration to update
      continue;
    }
๐Ÿ› Bug report
Status

Fixed

Version

4.0

Component

Code

Created by

๐Ÿ‡บ๐Ÿ‡ธUnited States zerbash

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