PHP warning

Attempt to read property "subquestions" on null

/media/shnoulle/data/www/master/application/models/Question.php(887)

875         );
876     }
877 
878     /**
879      * Return if question has managed subquestions
880      * usage in rules : allow set other even if existing subquestions 'other' exist (but deleted after)
881      * @return boolean
882      */
883     public function getAllowSubquestions()
884     {
885         return (
886             !$this->parent_qid
887             && $this->getQuestionType()->subquestions
888         );
889     }
890 
891     /**
892      * Return true if the question type supports answer options
893      * @return boolean
894      */
895     public function getAllowAnswerOptions()
896     {
897         return (
898             !$this->parent_qid
899             && $this->getQuestionType()->answerscales > 0

Stack Trace

#0
+
–
 /media/shnoulle/data/www/master/application/models/Question.php(1507): Question->getAllowSubquestions()
1502      * Check if this question have subquestion with other code
1503      * @return boolean
1504      */
1505     public function getHasOtherSubquestions()
1506     {
1507         if (!$this->getAllowSubquestions()) {
1508             return false;
1509         }
1510         $otherSubQuestionCount = Question::model()->count(
1511             "parent_qid=:parent_qid and LOWER(title)='other'",
1512             array("parent_qid" => $this->qid)
#1
+
–
 /media/shnoulle/data/www/master/application/models/Question.php(237): Question->getHasOtherSubquestions()
232             if ($oParentQuestion->type == "P") {
233                 $aRules[] = array('title', 'match', 'pattern' => '/comment$/', 'not' => true, 'message' => gT("'comment' suffix can not be used with multiple choice with comments."));
234             }
235         } else {
236             /* Question specific rules*/
237             if ($this->getHasOtherSubquestions()) {
238                 // Disallow other if sub question have 'other' for title
239                 $aRules[] = array('other', 'compare', 'compareValue' => 'Y', 'operator' => '!=', 'message' => sprintf(gT("'%s' can not be used if the 'Other' option for this question is activated."), 'other'));
240             }
241         }
242         if (!empty($this->survey) && $this->survey->isActive) {
#6
+
–
 /media/shnoulle/data/www/master/application/models/services/CopyQuestion.php(137): CActiveRecord->save()
132         } else {
133             $this->newQuestion->sid = $this->copyQuestionValues->getOSurvey()->sid;
134         }
135 
136 
137         return $this->newQuestion->save();
138     }
139 
140     /**
141      * Copies the languages of a question.
142      *
2026-11-20 10:48:30 nginx/1.26.3 Yii Framework/1.1.33-dev