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);

CommentFileSizeAuthor
#2 After.png147.26 KBkeshavv
#2 Before.png180.01 KBkeshavv
#2 3379808-2.patch572 byteskeshavv

Comments

rubenjara created an issue. See original summary.

keshavv’s picture

Status: Active » Reviewed & tested by the community
StatusFileSize
new572 bytes
new180.01 KB
new147.26 KB

There is an issue and the solution provided works well.
Created patch, Added SS, and moved to RTBC.

daniel.moberly’s picture

Status: Reviewed & tested by the community » Fixed

Committed.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.