Review main Merged

42298[BUGFIX] Submitted form data has precedence over value argument

Markus Günther CR +2 V +2 Hard +560 −172 updated 08/06/15, 17:10

Commit message

This adjusts the behavior of all Form ViewHelpers so that any
submitted value is redisplayed even if a "value" argument has been
specified.

The issue with this, however, was that upon re-display of the form due
to property-mapping or validation errors the value argument had
precedence over the previously submitted value.

This is a breaking change if you expect the previous behavior of form
ViewHelpers always being pre-populated with the specified value
attribute / bound object property even when re-displaying the form upon
validation errors.
Besides this change deprecates
``AbstractFormFieldViewHelper::getValue()``. If you call that method in
your custom ViewHelpers you should use
``AbstractFormFieldViewHelper::getValueAttribute()`` instead and call
``AbstractFormFieldViewHelper::addAdditionalIdentityPropertiesIfNeeded()``
explicitly if the ViewHelper might be bound to (sub)entities.

The default usage of getValueAttribute() not respect the submitted form data, because not every viewhelper need
this feature. But you can enable the usage of the form data by setting the
AbstractFormFieldViewHelper::respectSubmittedDataValue to TRUE.

Review

  • Code review CR +2
    • Anja Leichsenring +2
    • Sascha Wilking +1
    • Susi Moog +1
  • Verified V +2
    • Anja Leichsenring +2
    • Sascha Wilking +1

Issues 2

Files 17

Review log 14

  1. Markus Günther uploaded patch set 1 08/05/15, 21:05

  2. Markus Günther commented on patch set 1 08/05/15, 21:05

    I still need to fix the unit test.
  3. Mathias Brodala commented on patch set 1 CR -1 08/06/15, 07:11

    Please add a Deprecation .rst for this.

    ButtonViewHelper.php:115

    Maybe put this into a Trait to avoid code duplication?
  4. Markus Günther uploaded patch set 2 08/06/15, 09:18

  5. Markus Günther commented on patch set 2 08/06/15, 09:20

    Still need to fix the unit tests, but find another way to prevent the code duplication. Discussed that with Frank and Anja!
  6. Markus Günther uploaded patch set 3 08/06/15, 12:29

  7. Markus Günther commented on patch set 2 08/06/15, 12:30

    Ok now ready for review and with working tests.
  8. Sascha Wilking voted on patch set 3 CR +1 V +1 08/06/15, 16:39

  9. Anja Leichsenring uploaded patch set 4 08/06/15, 17:01

  10. Sascha Wilking voted on patch set 4 CR +1 V +1 08/06/15, 17:01

  11. Anja Leichsenring voted on patch set 4 CR +1 V +1 08/06/15, 17:04

  12. Susi Moog voted on patch set 4 CR +1 08/06/15, 17:10

  13. Anja Leichsenring voted on patch set 4 CR +2 V +2 08/06/15, 17:10

  14. Anja Leichsenring merged patch set 4 08/06/15, 17:10