Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-5437

When a ConversionException is thrown, its message is not used in the ValidationError

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 6.11.0
    • 6.13.0, 7.0.0-M1
    • wicket
    • None

    Description

      Probably affects 6.12 also, though haven't checked.

      As noted by Martin Grigorov in ISIS-621:

      The code for creating a ValidationError is at
      https://github.com/apache/wicket/blob/master/wicket-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java?source=c#L1219

      As you can see the cause's message is not used :-/

      The problem is:
      ValidationError error = new ValidationError();

      it should be:
      ValidationError error = new ValidationError(cause.getMessage());

      Later at https://github.com/apache/wicket/blob/master/wicket-core/src/main/java/org/apache/wicket/validation/ValidationError.java?source=c#L241 Wicket will look for i18n keys and fallback to the message.

      Attachments

        Activity

          People

            mgrigorov Martin Tzvetanov Grigorov
            danhaywood Daniel Keir Haywood
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: