sitegeist / translatelabels

TYPO3 extension to find and translate labels in frontend and admin panel
GNU General Public License v2.0
3 stars 8 forks source link

Form Framework: Number - step option bug #19

Open madalinatarcea opened 2 years ago

madalinatarcea commented 2 years ago

If we set the step option we got this error: bcs the value from step is int

Screen Shot 2021-08-27 at 8 15 23 AM

Could you pls fix that? maybe adding on line: 142 -> Classes/ViewHelpers/TranslateElementPropertyViewHelper.php if (is_string($value)) { $ret[$key] = self::renderTranslation( $translationKey . '.' . $key, $value, $translationArguments ); }

galoppi commented 2 years ago

Which TYPO3 version do you use?

madalinatarcea commented 2 years ago

typo3 10.4.19

galoppi commented 2 years ago

@madalinatarcea: Could you please check if the error still exists in version 2.0.12 of this extension? If yes, please give me more details, f.e. the yaml file of your form definition, so that I can reproduce the error.

bakfunk commented 2 years ago

@galoppi unfortunatly the error still exisits in version 2.0.12, i am a coworker of @madalinatarcea and working on a project with the same bug.

In the Yaml File the step option creates the bug as @madalinatarcea said. Here an example:

   -
        defaultValue: ''
        properties:
          fluidAdditionalAttributes:
            step: 1
        type: Number
        identifier: number-1
        label: Number
        validators:
          -
            identifier: Number
      -

Here an example form that triggers the bug:


<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" xmlns:formvh="http://typo3.org/ns/TYPO3/CMS/Form/ViewHelpers" data-namespace-typo3-fluid="true">
<formvh:renderRenderable renderable="{form}">
        <formvh:form
                object="{form}"
                action="{form.renderingOptions.controllerAction}"
                method="{form.renderingOptions.httpMethod}"
                id="{form.identifier}"
                section="{form.identifier}"
                enctype="{form.renderingOptions.httpEnctype}"
                addQueryString="{form.renderingOptions.addQueryString}"
                argumentsToBeExcludedFromQueryString="{form.renderingOptions.argumentsToBeExcludedFromQueryString}"
                additionalParams="{form.renderingOptions.additionalParams}"
                additionalAttributes="{formvh:translateElementProperty(element: form, property: 'fluidAdditionalAttributes')}"
                class="js-form"
        >
          <div class="js-message_error message_error" data-emptyErrorMsg="{f:translate(key: 'validation.empty.errorMsg', extensionName: 'test')}" data-emailErrorMsg="{f:translate(key: 'validation.email.errorMsg', extensionName: 'test')}"></div>
            <f:render partial="{form.currentPage.templateName}" arguments="{page: form.currentPage}" />
            <div class="actions">

                <f:render partial="Form/Navigation" arguments="{form: form}" />
            </div>

        </formvh:form>
</formvh:renderRenderable>
</html>