Whenever I try to look at at Long Answer question, I get an error. The error is as follows:

Notice: Undefined property: LongAnswerQuestion::$question in QuizQuestion->getFormat() (line 623 of /var/www/sites/all/modules/quiz/question_types/quiz_question/quiz_question.core.inc).
EntityMalformedException: Missing bundle property on entity of type node. in entity_extract_ids() (line 7633 of /var/www/includes/common.inc).

I'll start diving into this but I wouldn't mind help either.

Comments

sivaji_ganesh_jojodae’s picture

Status: Active » Needs review

The patch below fixed it for me,

--- a/sites/all/modules/custom/quiz/question_types/quiz_question/quiz_question.core.inc
+++ b/sites/all/modules/custom/quiz/question_types/quiz_question/quiz_question.core.inc
@@ -620,7 +620,8 @@ abstract class QuizQuestion {
    * Utility function that returns the format of the node body
    */
   protected function getFormat() {
-    $body = field_get_items('node', $this->question, 'body');
+    $node = isset($this->node) ? $this->node : $this->question;
+    $body = field_get_items('node', $node, 'body');
     return ($body ? $body[0]['format'] : NULL);
   }
 }
sivaji_ganesh_jojodae’s picture

Status: Needs review » Fixed

Committed the above mentioned fix to git.

Status: Fixed » Closed (fixed)

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

Babou’s picture

Version: 7.x-4.0-alpha12 » 7.x-4.0-beta1
Status: Closed (fixed) » Needs review
StatusFileSize
new607 bytes

I attach the patch as I need it to be hosted to get it from a drush make.

sivaji_ganesh_jojodae’s picture

...and you want the status to be needs review?

sivaji_ganesh_jojodae’s picture

Status: Needs review » Closed (fixed)

  • Commit 3ea8bca on 7.x-4.x, 7.x-5.x by sivaji:
    Issue #1899654 by mateomiguel: Fixed Can't view Long Answer questions.
    

  • Commit 3ea8bca on 7.x-4.x, 7.x-5.x, quiz-pages by sivaji:
    Issue #1899654 by mateomiguel: Fixed Can't view Long Answer questions.
    

  • Commit 3ea8bca on 7.x-4.x, 7.x-5.x, quiz-pages, 2269219 by sivaji:
    Issue #1899654 by mateomiguel: Fixed Can't view Long Answer questions.
    

  • Commit 3ea8bca on 7.x-4.x, 7.x-5.x, 2269219 by sivaji:
    Issue #1899654 by mateomiguel: Fixed Can't view Long Answer questions.