Skip to content
Snippets Groups Projects
Commit 3467c949 authored by Sadashiv Dalvi's avatar Sadashiv Dalvi Committed by Sadashiv Dalvi
Browse files

Issue #3161027 by batkor, sadashiv: Cannot load the "google_api_client" entity with NULL ID

parent e667b331
Branches
Tags 8.x-3.1
No related merge requests found
......@@ -577,6 +577,14 @@ class GoogleApiClient extends ContentEntityBase implements GoogleApiClientInterf
* @throws \Drupal\Core\Entity\EntityStorageException
*/
public function save() {
// Skip for new entity.
if ($this->isNew()) {
if ($this->getAccessToken() == '' || $this->getAccessToken() == NULL) {
$this->setAccessToken('');
$this->setAuthenticated(FALSE);
}
return parent::save();
}
$original = $this->original ? $this->original : NULL;
if (!$original) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment