Skip to content

Commit e571620

Browse files
committed
Fix Payment fields displaying in Summary field content by default
# Conflicts: # src/fields/Payment.php
1 parent e42473b commit e571620

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

src/elements/Submission.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1067,6 +1067,11 @@ public function getValuesForSummary(): array
10671067
$value = $this->getFieldValue($field->handle);
10681068
$html = $field->getValueForSummary($value, $this);
10691069

1070+
// Just in case some fields want to opt-out
1071+
if ($html === false || $html === null) {
1072+
continue;
1073+
}
1074+
10701075
$items[] = [
10711076
'field' => $field,
10721077
'value' => $value,

src/fields/Payment.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,11 @@ protected function defineValueAsString(mixed $value, ElementInterface $element =
278278
return (string)$value;
279279
}
280280

281+
public function getValueForSummary(mixed $value, ?ElementInterface $element = null): mixed
282+
{
283+
return false;
284+
}
285+
281286
protected function defineValueForEmailPreview(FakerFactory $faker): mixed
282287
{
283288
// Payment fields can't really be previewed without real payment data

0 commit comments

Comments
 (0)