Implemented additional event information
This commit is contained in:
+8
-4
@@ -27,7 +27,7 @@ class SetParticipationOptionsCommand
|
||||
* Geltungsbereichs eindeutig, damit Antworten robust referenzieren können.
|
||||
*
|
||||
* @param array<int, array<string, mixed>> $questions
|
||||
* @return array<int, array{key: string, label: string, options: array<int, array{value: string, label: string}>}>
|
||||
* @return array<int, array{key: string, title: string, label: string, options: array<int, array{value: string, label: string}>}>
|
||||
*/
|
||||
private function normalize(array $questions): array
|
||||
{
|
||||
@@ -35,21 +35,25 @@ class SetParticipationOptionsCommand
|
||||
$usedKeys = [];
|
||||
|
||||
foreach ($questions as $question) {
|
||||
$label = trim((string)($question['label'] ?? ''));
|
||||
if ($label === '') {
|
||||
// Titel ist Pflicht (Überschrift/Feldbeschriftung); die Frage ist optionaler Erklärtext.
|
||||
$title = trim((string)($question['title'] ?? ''));
|
||||
if ($title === '') {
|
||||
continue;
|
||||
}
|
||||
|
||||
$label = trim((string)($question['label'] ?? ''));
|
||||
|
||||
$options = $this->normalizeOptions($question['options'] ?? []);
|
||||
if ($options === []) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$key = $this->uniqueSlug((string)($question['key'] ?? ''), $label, $usedKeys);
|
||||
$key = $this->uniqueSlug((string)($question['key'] ?? ''), $title, $usedKeys);
|
||||
$usedKeys[] = $key;
|
||||
|
||||
$normalized[] = [
|
||||
'key' => $key,
|
||||
'title' => $title,
|
||||
'label' => $label,
|
||||
'options' => $options,
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user