diff --git a/src/Celsius3/CoreBundle/Controller/AdminOrderController.php b/src/Celsius3/CoreBundle/Controller/AdminOrderController.php index bd955aa61..5fd8a8cef 100644 --- a/src/Celsius3/CoreBundle/Controller/AdminOrderController.php +++ b/src/Celsius3/CoreBundle/Controller/AdminOrderController.php @@ -188,7 +188,7 @@ public function editAction($id) 'actual_user' => $this->getUser(), 'journal' => $journal, 'other' => $other, - 'journal_id' => $journal->getId(), + 'journal_id' => !is_null($journal) ? $journal->getId() : '', )); diff --git a/src/Celsius3/CoreBundle/Form/Type/OrderType.php b/src/Celsius3/CoreBundle/Form/Type/OrderType.php index 0a2bbdd9a..d4e37fbc4 100644 --- a/src/Celsius3/CoreBundle/Form/Type/OrderType.php +++ b/src/Celsius3/CoreBundle/Form/Type/OrderType.php @@ -43,7 +43,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) 'constraints' => new Valid(), 'journal' => $options['journal'], 'other' => $options['other'], - 'journal_id' => $options['journal_id'], + 'journal_id' => !is_null($options['journal_id']) ? $options['journal_id'] : '' , ); } else { $materialOptions = array(