Wicket
  1. Wicket
  2. WICKET-4775

PageParameters#mergeWith may loose values of the 'other' PP

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.5.8, 6.0.0
    • Fix Version/s: 6.1.0
    • Component/s: wicket
    • Labels:
      None

      Description

      The code at org.apache.wicket.request.mapper.parameter.PageParameters#mergeWith() looks like:

      for (NamedPair curNamed : other.getAllNamed())
      set(curNamed.getKey(), curNamed.getValue());

      may loose some values if 'other' has a named parameter with several values.With the current code only the last name/value pair is preserved.

        Activity

        Hide
        Emond Papegaaij added a comment -

        The merge method now first removes named keys and adds them from 'other'. This preserves multiple values in 'other'.

        While fixing this bug, I've also discovered and fixed a bug in merging index parameters: if this contains '0' and '1' and other contains '1' and '2', the value under '0' was overwritten with null.

        Show
        Emond Papegaaij added a comment - The merge method now first removes named keys and adds them from 'other'. This preserves multiple values in 'other'. While fixing this bug, I've also discovered and fixed a bug in merging index parameters: if this contains '0' and '1' and other contains '1' and '2', the value under '0' was overwritten with null.

          People

          • Assignee:
            Emond Papegaaij
            Reporter:
            Martin Grigorov
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development