Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions Form/SelectionUpdateForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Propel\Runtime\ActiveQuery\Criteria;
use Propel\Runtime\Exception\PropelException;
use Selection\Model\SelectionContainerAssociatedSelectionQuery;
use Selection\Model\SelectionContainerQuery;
use Selection\Model\SelectionQuery;
use Selection\Selection;
Expand Down Expand Up @@ -129,14 +130,19 @@ function (FormEvent $event) {
$data = $event->getData();
$selectionContainerWrongValue = $data['selection_container'];
$data['selection_container_id'] = null;
if (null !== $selectionContainerWrongValue) {
$selectionContainerValue = $this->containersArray[$selectionContainerWrongValue];
$data['selection_container_id'] = $selectionContainerValue;
$selectionContainer = SelectionContainerAssociatedSelectionQuery::create()
->filterBySelectionId($data['selection_id'])
->filterBySelectionContainerId($selectionContainerWrongValue)
->findOne();

if (null !== $selectionContainer) {
$data['selection_container_id'] = $selectionContainer->getSelectionContainerId();
}
$event->setData($data);
}
);


$this->formBuilder->addEventListener(
FormEvents::PRE_SET_DATA,
function (FormEvent $event) {
Expand Down