Issue Task Closed

#104442Improve ViewHelper tests for "required"

Stephan Großberndt 07/19/24, 21:55 updated 08/06/24, 15:05

Description

ViewHelpers that do not register “required” as an argument (e.g. `PasswordViewHelper`) pass any value since Fluid v2.12.0 (see https://github.com/TYPO3/Fluid/pull/859).

ViewHelpers that register “required” as an argument (e.g. `TextfieldViewHelper`) interpret the specified value as a bool and if true always render `required=“required”` and omit the attribute if false.

Once this registration will be removed, `required=“false”` will be passed through as an arbitrary value and rendered in the browser.

While `required=“false”` is technically incorrect, browsers correctly interpret the sole existence of the attribute as “is required” no matter which value is set.

Improve the tests to make sure this case is handled correctly once the registration for “required” in the ViewHelpers is removed:
Usage of `required=“false”` should be logged as deprecated and simply be removed from the ViewHelper usage.

Reviews 1

History 47

  1. Stephan Großberndt changed Related to #104436 07/19/24, 21:56

  2. Stephan Großberndt changed Related to #104441 07/19/24, 21:56

  3. Gerrit Code Review pushed patch set 1 for main to change 85312 status New Under Review 07/19/24, 22:06

  4. Gerrit Code Review pushed patch set 2 for main to change 85312 07/19/24, 22:39

  5. Gerrit Code Review pushed patch set 3 for main to change 85312 07/19/24, 22:50

  6. Christian Kuhn changed Related to #104507 08/06/24, 15:04

  7. Christian Kuhn commented and changed status Under Review Closed 08/06/24, 15:05

    patch has been abandoned due to its close relation to a different change that tests the abstract as well. i hope it is ok to close here for now.