Project

General

Profile

Actions

Bug #91610

open

Fluid Forms Label and name can´t be an integer. -> Request Class TYPO3 9.5

Added by Benjamin Bomberg almost 4 years ago. Updated over 2 years ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
Extbase
Target version:
-
Start date:
2020-06-08
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
10
PHP Version:
7.3
Tags:
Forms, Fluid, Extbase
Complexity:
Is Regression:
Sprint Focus:
Actions #1

Updated by Benjamin Bomberg almost 4 years ago

  • Subject changed from Fluid Forms Label and name can´t be an integer. to Fluid Forms Label and name can´t be an integer. -> Request Class
  • Category set to Fluid Styled Content
  • PHP Version set to 7.3
  • Tags set to Forms, Fluid, Extbase

I got a little Problem with the Request Class of Typo3.

I have to use ID ´s from an Api to generate input fields for a fluid form.
The Problem here is:

public function setArgument($argumentName, $value)
    {
        if (!is_string($argumentName) || $argumentName === '') {
            throw new \TYPO3\CMS\Extbase\Mvc\Exception\InvalidArgumentNameException('Invalid argument name.', 1210858767);
        }
        if ($argumentName[0] === '_' && $argumentName[1] === '_') {
            $this->internalArguments[$argumentName] = $value;
            return;
        }
        if (!in_array($argumentName, ['@extension', '@subpackage', '@controller', '@action', '@format', '@vendor'], true)) {
            $this->arguments[$argumentName] = $value;
        }
    }

!is_string let me get an error all the time.

 <label for="{question.id}">{question.label}</label>
 <f:form.textfield class="form-control" name="{question.id}" additionalAttributes="{required: 'required'}"/>

The Problem is, that I have to send the inputs back to the Api, thats why I need the Id.
It´s also a problem that I dont know how many or what type of inputs coming from the API. It could be one, it could be 20...
Is there a solution for this? I dont want to change something in the core-code. And XClasses doenst work here right?

Best Regards,
Benjamin

Actions #2

Updated by Benjamin Bomberg almost 4 years ago

  • Subject changed from Fluid Forms Label and name can´t be an integer. -> Request Class to Fluid Forms Label and name can´t be an integer. -> Request Class TYPO3 9.5
Actions #3

Updated by Georg Ringer over 3 years ago

  • Tracker changed from Feature to Bug
  • Category changed from Fluid Styled Content to Extbase
  • TYPO3 Version set to 10
Actions #4

Updated by Gerrit Code Review over 3 years ago

  • Status changed from New to Under Review

Patch set 1 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/+/66215

Actions #5

Updated by Markus Klein over 3 years ago

Sidenote: Your label for-attribute is invalid, as the textfield does not have an "id" attribute (which must not be a number).
Correct HTML would be:

<label for="q{question.id}">{question.label}</label>
<f:form.textfield class="form-control" id="q{question.id}" name="{question.id}" additionalAttributes="{required: 'required'}"/>
Actions #6

Updated by Christian Kuhn over 2 years ago

  • Status changed from Under Review to New
Actions

Also available in: Atom PDF