Skip to content

Commit

Permalink
IBX-7957: Refactored code
Browse files Browse the repository at this point in the history
  • Loading branch information
bwajda committed Mar 15, 2024
1 parent 8c3a8c3 commit 42f6e42
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions src/lib/Form/EventSubscriber/SuppressValidationSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,11 @@ public function suppressValidationOnSaveDraft(PostSubmitEvent $event)
{
$form = $event->getForm();

if ($form->has('saveDraft')) {
if ($form->get('saveDraft')->isClicked()) {
$event->stopPropagation();
}
}

if ($form->has('saveDraftAndClose')) {
if ($form->get('saveDraftAndClose')->isClicked()) {
$event->stopPropagation();
}
if (
($form->has('saveDraft') && $form->get('saveDraft')->isClicked())
|| ($form->has('saveDraftAndClose') && $form->get('saveDraftAndClose')->isClicked())
) {
$event->stopPropagation();
}
}

Expand Down

0 comments on commit 42f6e42

Please sign in to comment.