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
- Run `composer require 'drupal/simple_oauth:^5.2'`
- Run `drush cr`
- Visit admin/config/services/consumer
Comment | File | Size | Author |
---|---|---|---|
#5 | drupal-consumers-patch.png | 171.02 KB | SenthilMohith |
#4 | consumer_clinet_id.patch | 497 bytes | apatel0325 |
Issue fork simple_oauth-3321690
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
Comment #2
championlife CreditAttribution: championlife commentedFixed by running Drupal updates. I apologise, this was submitted pre-coffee.
Comment #4
apatel0325 CreditAttribution: apatel0325 commentedThese 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!
Comment #5
SenthilMohith CreditAttribution: SenthilMohith as a volunteer and at Cognizant Technology Solutions for Cognizant Technology Solutions commentedYes, 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.