Skip to content

Commit

Permalink
GHI545 Fix deprecated error in php8.2 (PoetOS#546)
Browse files Browse the repository at this point in the history
  • Loading branch information
jason-platts authored Feb 23, 2024
1 parent 4564790 commit 743b2fb
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions questionnaire.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1764,9 +1764,12 @@ public function survey_copy($owner) {
$qidarray[$oldid] = $newqid;
foreach ($question->choices as $key => $choice) {
$oldcid = $key;
unset($choice->id);
$choice->question_id = $newqid;
if (!$newcid = $DB->insert_record('questionnaire_quest_choice', $choice)) {
$newchoice = (object) [
'question_id' => $newqid,
'content' => $choice->content,
'value' => $choice->value,
];
if (!$newcid = $DB->insert_record('questionnaire_quest_choice', $newchoice)) {
return(false);
}
$cidarray[$oldcid] = $newcid;
Expand Down

0 comments on commit 743b2fb

Please sign in to comment.