diff --git a/app/bundles/FormBundle/Resources/views/Builder/form.html.twig b/app/bundles/FormBundle/Resources/views/Builder/form.html.twig index 2fdcf135ccd..561b546fd8a 100644 --- a/app/bundles/FormBundle/Resources/views/Builder/form.html.twig +++ b/app/bundles/FormBundle/Resources/views/Builder/form.html.twig @@ -100,22 +100,8 @@ {%- set template = '@MauticForm/Field/' ~ f.type ~ '.html.twig' -%} {%- endif -%} - - {%- if theme is empty -%} - {{- include(theme ~ f.type ~ '.html.twig', { - 'field': f.convertToArray, - 'id': f.alias, - 'formName': formName, - 'fieldPage': (pageCount - 1), - 'mappedFields': mappedFields, - 'inBuilder': inBuilder, - 'fields': fields, - 'language': form.getLanguage() - - }) -}} - {%- else -%} - {{- include(template, { + {{- include([theme ~ f.type ~ '.html.twig', template], { 'field': f.convertToArray, 'id': f.alias, 'formName': formName, @@ -124,9 +110,7 @@ 'inBuilder': inBuilder, 'fields': fields, 'language': form.getLanguage() - }) -}} - {%- endif -%} {%- endif -%} {%- endfor -%} diff --git a/app/bundles/FormBundle/Tests/Controller/Api/FormApiControllerFunctionalTest.php b/app/bundles/FormBundle/Tests/Controller/Api/FormApiControllerFunctionalTest.php index a1b160b1616..244d140990b 100644 --- a/app/bundles/FormBundle/Tests/Controller/Api/FormApiControllerFunctionalTest.php +++ b/app/bundles/FormBundle/Tests/Controller/Api/FormApiControllerFunctionalTest.php @@ -156,7 +156,10 @@ public function testSingleFormWorkflow(): void $this->client->request(Request::METHOD_POST, '/api/forms/new', $payload); $clientResponse = $this->client->getResponse(); $response = json_decode($clientResponse->getContent(), true); - $formId = $response['form']['id']; + + Assert::assertTrue(isset($response['form']['id']), $clientResponse->getContent()); + + $formId = $response['form']['id']; $this->assertSame(Response::HTTP_CREATED, $clientResponse->getStatusCode(), $clientResponse->getContent()); $this->assertGreaterThan(0, $formId);