Error: Call to a member function id() on null

Created on 7 August 2023, over 1 year ago
Updated 8 August 2023, over 1 year ago

Problem/Motivation

A question is submitted for moderation, I go to the admin page to approve it, and I get this error.
Error: Call to a member function id() on null in Drupal\questions_answers\Entity\Question->getEntity() (line 262 of /var/www/store/web/modules/contrib/questions_answers/src/Entity/Question.php)

Proposed resolution

My temporary solution is to replace line 262 of Question.php with return \Drupal::entityTypeManager()->getStorage($this->get('bundle')->value)->load($this->get('entity_id')->target_id);

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇵🇾Paraguay rubenjara Paraguay

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

Comments & Activities

Production build 0.71.5 2024