Skip to content

Commit 9c94128

Browse files
committed
fix(target): fix warnings in timeline when no fiel uploaded
1 parent 6d6de39 commit 9c94128

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

inc/targetbase.class.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -772,10 +772,14 @@ protected function parseTags($content, PluginFormcreatorForm_Answer $formanswer,
772772
} else {
773773
if (strpos($content, '##answer_' . $id . '##') !== false) {
774774
$content = str_replace('##question_' . $id . '##', $name, $content);
775-
$content = str_replace('##answer_' . $id . '##', __('Attached document', 'formcreator'), $content);
776-
777-
// keep the ID of the document
778-
$this->attachedDocuments[$value] = true;
775+
if ($value !== '') {
776+
$content = str_replace('##answer_' . $id . '##', __('Attached document', 'formcreator'), $content);
777+
778+
// keep the ID of the document
779+
$this->attachedDocuments[$value] = true;
780+
} else {
781+
$content = str_replace('##answer_' . $id . '##', __('No document', 'formcreator'), $content);
782+
}
779783
}
780784
}
781785
}

0 commit comments

Comments
 (0)