New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dev: #19452: Improve usage of getQuestionAttributes DataEntry #3784
Dev: #19452: Improve usage of getQuestionAttributes DataEntry #3784
Conversation
$qidattributes = []; | ||
if (isset($fname['qid']) && isset($fname['type'])) { | ||
$qidattributes = QuestionAttribute::model()->getQuestionAttributes($fname['qid']); | ||
$qidattributes = QuestionAttribute::model()->getQuestionAttributes(Question::model()->findByPk($fname['qid'])); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is compatible with our goals of how we want to use getQuestionAttributes, that is, we intend to pass question objects rather than question ids to it, but let's load the questions separately in a single query rather than running an individual query for each question.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, maybe check if we call it multiple times ( same qid for subquestions).
Didn't get it in memory, just keep last qid done since we call sub question in a raw.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated : usage on question object in one another question.
…n::model()->findByPk( when it's neeed Dev: not for other question, and not in other foreach
@@ -822,7 +827,7 @@ public function editdata($subaction, $id, $surveyid) | |||
$questionInput .= ">{$optionarray['answer']}</option>\n"; | |||
} | |||
} | |||
if ($oQuestion->other == "Y") { | |||
if (($oQuestion->other ?? "N") == "Y") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really ?
No description provided.