Skip to content

Commit

Permalink
Revert "Fix express form update form name"
Browse files Browse the repository at this point in the history
This reverts commit 7bb557c.
  • Loading branch information
aembler committed Jan 22, 2024
1 parent ffd3ec8 commit 749e9f5
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions concrete/blocks/express_form/controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -423,32 +423,21 @@ public function save($data)

// Add mode
if (isset($data['exFormID']) && $data['exFormID'] !== '') {
$form = $entityManager->find(Form::class, $data['exFormID']);
if ($form && isset($data['formName']) && $data['formName'] !== '') {
$entity = $form->getEntity();
$entity->setName($data['formName']);
$entityManager->persist($entity);
$entityManager->flush();
}
return parent::save($data);
} else {
$fieldSet = $this->getFormFieldSet();
if ($fieldSet) {
$form = $fieldSet->getForm();
$entity = $form->getEntity();
if (isset($data['formName']) && $data['formName'] !== '') {
$entity->setName($data['formName']);
}
$data['exFormID'] = $form->getId();
}

if ($this->exFormID === null) {
// Add block - totally new form. We have to publish it before it is live.
$entity->setIsPublished(true);
$entityManager->persist($entity);
$entityManager->flush();
}

$entityManager->persist($entity);
$entityManager->flush();
}

if (!$entity) {
Expand Down

0 comments on commit 749e9f5

Please sign in to comment.