Skip to content
Snippets Groups Projects
Commit 1f398b65 authored by David Siegfried's avatar David Siegfried Committed by Jan-Hendrik Willms
Browse files

prevent php8-warnings, closes #3475

Closes #3475

Merge request studip/studip!2371
parent 05e69501
No related branches found
No related tags found
No related merge requests found
...@@ -27,6 +27,7 @@ $options = $vote->questiondata['options']; ...@@ -27,6 +27,7 @@ $options = $vote->questiondata['options'];
</thead> </thead>
<tbody> <tbody>
<? $countAnswers = $vote->questionnaire->countAnswers() ?> <? $countAnswers = $vote->questionnaire->countAnswers() ?>
<? if (!empty($vote->questiondata['statements'])) : ?>
<? foreach ($vote->questiondata['statements'] as $key => $statement) : ?> <? foreach ($vote->questiondata['statements'] as $key => $statement) : ?>
<tr> <tr>
<td> <td>
...@@ -66,5 +67,6 @@ $options = $vote->questiondata['options']; ...@@ -66,5 +67,6 @@ $options = $vote->questiondata['options'];
<? endforeach ?> <? endforeach ?>
</tr> </tr>
<? endforeach ?> <? endforeach ?>
<? endif ?>
</tbody> </tbody>
</table> </table>
...@@ -32,7 +32,7 @@ class LikertScale extends QuestionnaireQuestion implements QuestionType ...@@ -32,7 +32,7 @@ class LikertScale extends QuestionnaireQuestion implements QuestionType
$questiondata['description'] = \Studip\Markup::markAsHtml( $questiondata['description'] = \Studip\Markup::markAsHtml(
\Studip\Markup::purifyHtml($questiondata['description']) \Studip\Markup::purifyHtml($questiondata['description'])
); );
$questiondata['statements'] = array_filter($questiondata['statements']); $questiondata['statements'] = array_filter($questiondata['statements'] ?? []);
return $questiondata; return $questiondata;
} }
......
...@@ -27,7 +27,7 @@ class RangeScale extends QuestionnaireQuestion implements QuestionType ...@@ -27,7 +27,7 @@ class RangeScale extends QuestionnaireQuestion implements QuestionType
$questiondata['description'] = \Studip\Markup::markAsHtml( $questiondata['description'] = \Studip\Markup::markAsHtml(
\Studip\Markup::purifyHtml($questiondata['description']) \Studip\Markup::purifyHtml($questiondata['description'])
); );
$questiondata['statements'] = array_filter($questiondata['statements']); $questiondata['statements'] = array_filter($questiondata['statements'] ?? []);
return $questiondata; return $questiondata;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment