Skip to content

Commit

Permalink
IBX-902: When creating content on the fly doesn't have categories tabs
Browse files Browse the repository at this point in the history
  • Loading branch information
damianz5 committed Sep 3, 2021
1 parent 429f955 commit 0331436
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"symfony/yaml": "^5.0",
"jms/translation-bundle": "^1.5",
"ezsystems/ezplatform-kernel": "^1.3@dev",
"ezsystems/ezplatform-content-forms": "^1.0@dev",
"ezsystems/ezplatform-content-forms": "^1.3@dev",
"ezsystems/ezplatform-design-engine": "^3.0@dev",
"ezsystems/ezplatform-user": "^2.0@dev",
"ezsystems/ezplatform-richtext": "^2.0@dev",
Expand Down
12 changes: 12 additions & 0 deletions src/bundle/Controller/ContentOnTheFlyController.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
use EzSystems\EzPlatformContentForms\Data\Mapper\ContentUpdateMapper;
use EzSystems\EzPlatformContentForms\Form\ActionDispatcher\ActionDispatcherInterface;
use EzSystems\EzPlatformContentForms\Form\Type\Content\ContentEditType;
use Ibexa\Contracts\ContentForms\Content\Form\Provider\GroupedContentFormFieldsProviderInterface;
use Symfony\Component\Form\FormInterface;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Request;
Expand All @@ -57,6 +58,9 @@ class ContentOnTheFlyController extends Controller
/** @var \eZ\Publish\API\Repository\PermissionResolver */
private $permissionResolver;

/** @var \Ibexa\Contracts\ContentForms\Content\Form\Provider\GroupedContentFormFieldsProviderInterface */
private $groupedContentFormFieldsProvider;

/** @var \eZ\Publish\Core\MVC\Symfony\Locale\UserLanguagePreferenceProviderInterface */
private $userLanguagePreferenceProvider;

Expand All @@ -78,6 +82,7 @@ public function __construct(
LocationService $locationService,
ContentTypeService $contentTypeService,
PermissionResolver $permissionResolver,
GroupedContentFormFieldsProviderInterface $groupedContentFormFieldsProvider,
UserLanguagePreferenceProviderInterface $userLanguagePreferenceProvider,
CreateContentOnTheFlyDispatcher $createContentActionDispatcher,
ConfigResolverInterface $configResolver,
Expand All @@ -89,6 +94,7 @@ public function __construct(
$this->languageService = $languageService;
$this->contentTypeService = $contentTypeService;
$this->permissionResolver = $permissionResolver;
$this->groupedContentFormFieldsProvider = $groupedContentFormFieldsProvider;
$this->userLanguagePreferenceProvider = $userLanguagePreferenceProvider;
$this->createContentActionDispatcher = $createContentActionDispatcher;
$this->configResolver = $configResolver;
Expand Down Expand Up @@ -213,6 +219,9 @@ public function createContentAction(
'language' => $language,
'content_type' => $contentType,
'parent_location' => $parentLocation,
'grouped_fields' => $this->groupedContentFormFieldsProvider->getGroupedFields(
$form->get('fieldsData')
),
]);
}

Expand Down Expand Up @@ -354,6 +363,9 @@ private function buildEditView(
'language' => $language,
'content_type' => $contentType,
'form' => $form->createView(),
'grouped_fields' => $this->groupedContentFormFieldsProvider->getGroupedFields(
$form->get('fieldsData')
),
]);

return $view;
Expand Down

0 comments on commit 0331436

Please sign in to comment.