Skip to content

Commit 0560619

Browse files
committed
Only add a row if none exist
1 parent 372dec6 commit 0560619

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/ManyField.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,10 +294,11 @@ public function FieldList() {
294294
foreach ($this->value as $record) {
295295
$output->push($this->generateRow($index++, $record));
296296
}
297+
} else {
298+
// display one if none exist.
299+
$output->push($this->generateRow($index++));
297300
}
298301

299-
$output->push($this->generateRow($index++));
300-
301302
return $output;
302303
}
303304

0 commit comments

Comments
 (0)