Skip to content

Commit b7e1baa

Browse files
committed
The allow add is only needed if the collections isn't prefilled
1 parent 80852dc commit b7e1baa

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Bridge/Interaction/CollectionInteractor.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,10 @@ public function interactWith(
5454
throw new CanNotInteractWithForm('Expected a "collection" form');
5555
}
5656

57-
if (!$form->getConfig()->getOption('allow_add')) {
58-
throw new FormNotReadyForInteraction('The "collection" form should have the option "allow_add"');
57+
if (!$form->getConfig()->getOption('allow_add') && empty($form->getData())) {
58+
throw new FormNotReadyForInteraction(
59+
'The "collection" form should have the option "allow_add" or have existing entries'
60+
);
5961
}
6062

6163
$this->printHeader($form, $output);

0 commit comments

Comments
 (0)