Project

General

Profile

Actions

Bug #92406

open

Using formvh:render without extbase context results in Exception

Added by Daniel Siepmann about 4 years ago. Updated 11 months ago.

Status:
New
Priority:
Should have
Category:
Form Framework
Target version:
-
Start date:
2020-09-25
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
10
PHP Version:
7.3
Tags:
Complexity:
Is Regression:
Sprint Focus:
Remote Sprint

Description

Using

<formvh:render persistenceIdentifier="EXT:sitepackage/Resources/Private/Forms/enquiry.form.yaml" />
inside an arbitrary Fluid template results in
Argument 1 passed to TYPO3\CMS\Extbase\Service\ExtensionService::getPluginNameByAction() must be of the type string, null given, called in /var/www/html/public/typo3/sysext/extbase/Classes/Mvc/Web/Routing/UriBuilder.php on line 609
. It looks like the reason is
$form = $formDefinition->bind($renderingContext->getControllerContext()->getRequest(), $response);
inside the ViewHelper.

I guess it should be possible to detect the state, and create a fake request with the expected defaults to the EXT:form plugin itself to make it way easier. Alternatively one could set the necessary info through additional arguments. Just like in the example when using FLUIDTEMPLATE: https://docs.typo3.org/c/typo3/cms-form/10.4/en-us/I/Concepts/FrontendRendering/Index.html#render-through-fluidtemplate-without-controller

It would make usage of EXT:form much easier if that would work out of the box.


Related issues 2 (1 open1 closed)

Related to TYPO3 Core - Feature #91419: Disable caching on a per form basisUnder Review2020-05-16

Actions
Related to TYPO3 Core - Bug #98222: Inconsistent form rendering after #93887Closed2022-08-29

Actions
Actions #1

Updated by Björn Jacob over 3 years ago

  • Sprint Focus set to Remote Sprint
Actions #2

Updated by Gerrit Code Review over 3 years ago

  • Status changed from New to Under Review

Patch set 7 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70460

Actions #3

Updated by Gerrit Code Review over 3 years ago

Patch set 3 for branch 10.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70513

Actions #4

Updated by Gerrit Code Review over 3 years ago

Patch set 8 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70460

Actions #5

Updated by Gerrit Code Review over 3 years ago

Patch set 4 for branch 10.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70513

Actions #6

Updated by Gerrit Code Review over 3 years ago

Patch set 9 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70460

Actions #7

Updated by Gerrit Code Review over 3 years ago

Patch set 10 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70460

Actions #8

Updated by Gerrit Code Review over 3 years ago

Patch set 11 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70460

Actions #9

Updated by Gerrit Code Review over 3 years ago

Patch set 12 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70460

Actions #10

Updated by Björn Jacob over 3 years ago

  • Related to Feature #91419: Disable caching on a per form basis added
Actions #11

Updated by Björn Jacob over 3 years ago

  • Assignee set to Ralf Zimmermann
Actions #12

Updated by Gerrit Code Review over 3 years ago

Patch set 13 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70460

Actions #13

Updated by Gerrit Code Review over 3 years ago

Patch set 14 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70460

Actions #14

Updated by Gerrit Code Review over 3 years ago

Patch set 15 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70460

Actions #15

Updated by Gerrit Code Review over 3 years ago

Patch set 5 for branch 10.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70513

Actions #16

Updated by Gerrit Code Review over 3 years ago

Patch set 16 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70460

Actions #17

Updated by Gerrit Code Review over 3 years ago

Patch set 6 for branch 10.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70513

Actions #18

Updated by Gerrit Code Review over 3 years ago

Patch set 17 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70460

Actions #19

Updated by Gerrit Code Review over 3 years ago

Patch set 18 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70460

Actions #20

Updated by Gerrit Code Review over 3 years ago

Patch set 19 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70460

Actions #21

Updated by Gerrit Code Review over 3 years ago

Patch set 20 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70460

Actions #22

Updated by Gerrit Code Review over 3 years ago

Patch set 7 for branch 10.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70513

Actions #23

Updated by Gerrit Code Review over 3 years ago

Patch set 21 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70460

Actions #24

Updated by Gerrit Code Review over 3 years ago

Patch set 22 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70460

Actions #25

Updated by Gerrit Code Review over 3 years ago

Patch set 8 for branch 10.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70513

Actions #26

Updated by Gerrit Code Review over 3 years ago

Patch set 23 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70460

Actions #27

Updated by Gerrit Code Review about 3 years ago

Patch set 24 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70460

Actions #28

Updated by Gerrit Code Review about 3 years ago

Patch set 25 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70460

Actions #29

Updated by Gerrit Code Review about 3 years ago

Patch set 26 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70460

Actions #30

Updated by Gerrit Code Review almost 3 years ago

Patch set 27 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70460

Actions #31

Updated by Gerrit Code Review over 2 years ago

Patch set 28 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70460

Actions #32

Updated by Gerrit Code Review over 2 years ago

Patch set 29 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70460

Actions #33

Updated by Gerrit Code Review over 2 years ago

Patch set 30 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70460

Actions #34

Updated by Gerrit Code Review over 2 years ago

Patch set 31 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70460

Actions #35

Updated by Gerrit Code Review over 2 years ago

Patch set 32 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70460

Actions #36

Updated by Gerrit Code Review over 2 years ago

Patch set 33 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70460

Actions #37

Updated by Gerrit Code Review over 2 years ago

Patch set 34 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70460

Actions #38

Updated by Gerrit Code Review over 2 years ago

Patch set 35 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70460

Actions #39

Updated by Gerrit Code Review over 2 years ago

Patch set 36 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70460

Actions #40

Updated by Gerrit Code Review over 2 years ago

Patch set 37 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70460

Actions #41

Updated by Gerrit Code Review over 2 years ago

Patch set 38 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70460

Actions #42

Updated by Gerrit Code Review over 2 years ago

Patch set 39 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70460

Actions #43

Updated by Gerrit Code Review over 2 years ago

Patch set 40 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70460

Actions #44

Updated by Gerrit Code Review over 2 years ago

Patch set 41 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70460

Actions #45

Updated by Gerrit Code Review over 2 years ago

Patch set 42 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70460

Actions #46

Updated by Gerrit Code Review over 2 years ago

Patch set 43 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70460

Actions #47

Updated by Gerrit Code Review over 2 years ago

Patch set 44 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70460

Actions #48

Updated by Gerrit Code Review over 2 years ago

Patch set 45 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70460

Actions #49

Updated by Gerrit Code Review over 2 years ago

Patch set 46 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70460

Actions #50

Updated by Gerrit Code Review over 2 years ago

Patch set 47 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70460

Actions #51

Updated by Gerrit Code Review over 2 years ago

Patch set 48 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70460

Actions #52

Updated by Gerrit Code Review over 2 years ago

Patch set 49 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70460

Actions #53

Updated by Gerrit Code Review over 2 years ago

Patch set 50 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70460

Actions #54

Updated by Gerrit Code Review over 2 years ago

Patch set 51 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70460

Actions #55

Updated by Gerrit Code Review over 2 years ago

Patch set 52 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70460

Actions #56

Updated by Gerrit Code Review over 2 years ago

Patch set 53 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70460

Actions #57

Updated by Gerrit Code Review over 2 years ago

Patch set 54 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70460

Actions #58

Updated by Gerrit Code Review over 2 years ago

Patch set 55 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70460

Actions #59

Updated by Gerrit Code Review over 2 years ago

Patch set 1 for branch 11.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/75013

Actions #60

Updated by Gerrit Code Review over 2 years ago

Patch set 2 for branch 11.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/75013

Actions #61

Updated by Gerrit Code Review over 2 years ago

Patch set 3 for branch 11.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/75013

Actions #62

Updated by Ralf Zimmermann over 2 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #63

Updated by Gerrit Code Review over 2 years ago

  • Status changed from Resolved to Under Review

Patch set 4 for branch 11.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/75013

Actions #64

Updated by Gerrit Code Review over 2 years ago

Patch set 5 for branch 11.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/75013

Actions #65

Updated by Gerrit Code Review over 2 years ago

Patch set 6 for branch 11.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/75013

Actions #66

Updated by Gerrit Code Review over 2 years ago

Patch set 7 for branch 11.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/75013

Actions #67

Updated by Gerrit Code Review over 2 years ago

Patch set 8 for branch 11.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/75013

Actions #68

Updated by Gerrit Code Review over 2 years ago

Patch set 9 for branch 11.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/75013

Actions #69

Updated by Ralf Zimmermann over 2 years ago

  • Status changed from Under Review to Resolved
Actions #70

Updated by Tim Obert over 2 years ago

Is there already a plan when the patch for 10.4 will be started?

Actions #71

Updated by Gerrit Code Review over 2 years ago

  • Status changed from Resolved to Under Review

Patch set 9 for branch 10.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70513

Actions #72

Updated by Gerrit Code Review over 2 years ago

Patch set 10 for branch 10.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70513

Actions #73

Updated by Gerrit Code Review over 2 years ago

Patch set 11 for branch 10.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70513

Actions #74

Updated by Gerrit Code Review over 2 years ago

Patch set 12 for branch 10.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70513

Actions #75

Updated by Gerrit Code Review over 2 years ago

Patch set 13 for branch 10.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70513

Actions #76

Updated by Gerrit Code Review over 2 years ago

Patch set 14 for branch 10.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70513

Actions #77

Updated by Elias Häußler about 2 years ago

  • Related to Bug #98222: Inconsistent form rendering after #93887 added
Actions #78

Updated by Christian Kuhn almost 2 years ago

  • Status changed from Under Review to New
Actions #79

Updated by Daniel Siepmann 11 months ago · Edited

Looks like the issue still exists in TYPO3 v12:


(1/1) TypeError

TYPO3\CMS\Form\Domain\Model\FormDefinition::bind(): Argument #1 ($request) must be of type TYPO3\CMS\Extbase\Mvc\RequestInterface, TYPO3\CMS\Core\Http\ServerRequest given, called in /vendor/typo3/cms-form/Classes/ViewHelpers/RenderViewHelper.php on line 97

We have the following "workaround":

TypoScript:

    variables {
        form = COA
        form {
            5 = USER
            5 {
                userFunc = Codappix\SiteCodappix\UserFunc\Form->prepare
            }
            10 = EXTBASEPLUGIN
            10 {
                extensionName = Form
                pluginName = Formframework
            }
        }
    }

The UserFunction is executed prior the plugin and will populate the pi_flexform accordingly.
Minimum example:

<?php

declare(strict_types=1);

namespace Codappix\SiteCodappix\UserFunc;

use TYPO3\CMS\Core\Configuration\FlexForm\FlexFormTools;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer;

final class Form
{
    private ContentObjectRenderer $renderer;

    public function setContentObjectRenderer(ContentObjectRenderer $renderer): void
    {
        $this->renderer = $renderer;
    }

    public function prepare(
    ): string {
        $flexForm = [
            'data' => [
                'sDEF' => [
                    'lDEF' => [
                        'settings.persistenceIdentifier' => $this->renderer->data['codappix_form'] ?? '',
                    ],
                ],
            ],
        ];

        $flexFormTools = GeneralUtility::makeInstance(FlexFormTools::class);

        $this->renderer->data['pi_flexform'] = $flexFormTools->flexArray2Xml($flexForm, true);
        return '';
    }
}

This can be fine tuned per case, e.g. use configuration to dynamically fetch the identifier from somewhere else, merge it with existing pi_flexform, etc.

One than can use the following in Fluid:

{form -> f:format.raw()}

Actions

Also available in: Atom PDF