Skip to content

Commit 391cdcf

Browse files
committed
chore: make sure text_output fields do not end up in endpoints
1 parent 5574b2e commit 391cdcf

3 files changed

Lines changed: 8 additions & 1 deletion

File tree

classes/ColdTrick/Forms/Definition/Field.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
namespace ColdTrick\Forms\Definition;
44

55
use ColdTrick\Forms\Exception\InvalidInputException;
6-
use Elgg\Values;
76
use Symfony\Component\HttpFoundation\File\UploadedFile;
87

98
/**
@@ -327,6 +326,9 @@ public function populateFromInput(): void {
327326
}
328327

329328
switch ($this->getType()) {
329+
case 'text_output':
330+
// field does not support input
331+
break;
330332
case 'file':
331333
$uploaded_files = elgg_get_uploaded_files($this->getName());
332334
if (empty($uploaded_files)) {

classes/ColdTrick/Forms/Endpoint/Csv.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ public function process(Result $result): bool {
2525
$value = $field->getValue();
2626

2727
switch ($field->getType()) {
28+
case 'text_output':
2829
case 'file':
2930
return;
3031
case 'longtext':

classes/ColdTrick/Forms/Endpoint/Email.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,10 @@ protected function getBody(): string {
8787

8888
foreach ($section->getFields() as $field) {
8989
$this->addRecipientFromField($field);
90+
if ($field->getType() === 'text_output') {
91+
continue;
92+
}
93+
9094
$field_content[] = $this->getBodyField($field);
9195

9296
// add the conditional sections based on the value of the field

0 commit comments

Comments
 (0)