Skip to content

Commit

Permalink
Make CoreBundle optional
Browse files Browse the repository at this point in the history
  • Loading branch information
wbloszyk committed Jun 4, 2020
1 parent 0a16728 commit a974c36
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@
"doctrine/orm": "^2.5",
"doctrine/persistence": "^1.3.4",
"sonata-project/admin-bundle": "^3.63",
"sonata-project/core-bundle": "^3.14",
"sonata-project/exporter": "^1.11.0 || ^2.0",
"sonata-project/form-extensions": "^0.1 || ^1.4",
"sonata-project/twig-extensions": "^0.1 || ^1.3",
"symfony/config": "^4.4",
"symfony/console": "^4.4",
"symfony/dependency-injection": "^4.4",
Expand Down
4 changes: 2 additions & 2 deletions src/Builder/FormContractor.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
use Sonata\AdminBundle\Form\Type\ModelListType;
use Sonata\AdminBundle\Form\Type\ModelType;
use Sonata\AdminBundle\Form\Type\ModelTypeList;
use Sonata\CoreBundle\Form\Type\CollectionType as DeprecatedCollectionType;
use Sonata\Form\Type\CollectionType;
use Symfony\Component\Form\Extension\Core\Type\FormType;
use Symfony\Component\Form\FormFactoryInterface;
Expand Down Expand Up @@ -159,7 +158,8 @@ public function getDefaultOptions($type, FieldDescriptionInterface $fieldDescrip
return $fieldDescription->getAssociationAdmin()->getNewInstance();
};
$fieldDescription->setOption('edit', $fieldDescription->getOption('edit', 'admin'));
} elseif ($this->checkFormClass($type, [CollectionType::class, DeprecatedCollectionType::class])) {
// NEXT_MAJOR: remove 'Sonata\CoreBundle\Form\Type\CollectionType'
} elseif ($this->checkFormClass($type, [CollectionType::class, 'Sonata\CoreBundle\Form\Type\CollectionType'])) {
if (!$fieldDescription->getAssociationAdmin()) {
throw new \RuntimeException(sprintf(
'The current field `%s` is not linked to an admin.'
Expand Down

0 comments on commit a974c36

Please sign in to comment.