Problem/Motivation

After upgrading from 5.0 to 5.2.2, I can no longer access my list of consumers at admin/config/services/consumer

The website encountered an unexpected error. Please try again later.
TypeError: Return value of Drupal\consumers\Entity\Consumer::getClientId() must be of the type string, null returned in Drupal\consumers\Entity\Consumer->getClientId() (line 252 of modules/composer/consumers/src/Entity/Consumer.php).
Drupal\consumers\Entity\Consumer->getClientId() (Line: 32)

Steps to reproduce

  1. Run `composer require 'drupal/simple_oauth:^5.2'`
  2. Run `drush cr`
  3. Visit admin/config/services/consumer
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:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

championlife created an issue. See original summary.

championlife’s picture

Status: Active » Closed (works as designed)

Fixed by running Drupal updates. I apologise, this was submitted pre-coffee.

apatel0325 made their first commit to this issue’s fork.

apatel0325’s picture

Status: Closed (works as designed) » Needs review
Issue tags: -
FileSize
497 bytes

These errors come from the consumers module so, you have to apply the patch on the consumers module.
I got the same problem and the issue is fixed when I run the patch.
Thanks!

SenthilMohith’s picture

Status: Needs review » Reviewed & tested by the community
FileSize
171.02 KB

Yes, the above error occurred in the consumers module. Got the below error while navigating to the page /admin/config/services/consumer.

TypeError: Drupal\consumers\Entity\Consumer::getClientId(): Return value must be of type string, null returned in Drupal\consumers\Entity\Consumer->getClientId() (line 252 of /var/www/docroot/modules/contrib/consumers/src/Entity/Consumer.php)

The root cause of this error might be the consumer entity doesn't have the value in the client ID. I have applied the patch #4 and it's loading the consumers page without any error.