Skip to content

Commit c783449

Browse files
mateuszdebinskiMateusz Dębiński
andauthored
IBX-6214: Set default action to publishContentType (#870)
* IBX-6327: default action set to publishContentType * moved publishContentType to const --------- Co-authored-by: Mateusz Dębiński <[email protected]>
1 parent 48b5668 commit c783449

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/bundle/Controller/ContentTypeController.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@
4848

4949
class ContentTypeController extends Controller
5050
{
51+
private const PRIMARY_UPDATE_ACTION = 'publishContentType';
52+
5153
/** @var \Ibexa\Contracts\AdminUi\Notification\TranslatableNotificationHandlerInterface */
5254
private $notificationHandler;
5355

@@ -501,10 +503,11 @@ public function updateAction(
501503
$language,
502504
$baseLanguage
503505
) {
506+
$action = $form->getClickedButton() ? $form->getClickedButton()->getName() : self::PRIMARY_UPDATE_ACTION;
504507
$this->contentTypeActionDispatcher->dispatchFormAction(
505508
$form,
506509
$form->getData(),
507-
$form->getClickedButton() ? $form->getClickedButton()->getName() : null,
510+
$action,
508511
['languageCode' => $language->languageCode]
509512
);
510513

@@ -519,7 +522,7 @@ public function updateAction(
519522
'content_type'
520523
);
521524

522-
if ('publishContentType' === $form->getClickedButton()->getName()) {
525+
if ($action === self::PRIMARY_UPDATE_ACTION) {
523526
return $this->redirectToRoute('ibexa.content_type.view', [
524527
'contentTypeGroupId' => $group->id,
525528
'contentTypeId' => $contentTypeDraft->id,

0 commit comments

Comments
 (0)