Wicket
  1. Wicket
  2. WICKET-1740

RequestCycle.urlFor modifies page parameters

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.3.4
    • Fix Version/s: 1.3.5, 1.4-RC1
    • Component/s: None
    • Labels:
      None

      Description

      The method RequestCycle.urlFor(final Component component,final RequestListenerInterface listener, ValueMap params) (RequestCycle.java line 824) obtains a PageParameters instance from the current page or creates a new instance if the page has no associated PageParameters. It then proceeds to add to the PageParameters instance all the parameters passed on the 'params' argument. If its using the PageParameters instance associated with the current Page that means the parameters of the page are permanently altered and any code later in the request cycle that depends upon these parameters is going to be broken.
      I believe the soluction would be to clone the PageParameters instance obtained from the Page, as in:

      PageParameters pageParameters = page.getPageParameters();
      if (pageParameters == null)

      { pageParameters = new PageParameters(); }

      else
      pageParameters = (PageParameters)pageParameters.clone();

      The above change doesn't seem to break any test cases.

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Johan Compagner
            Reporter:
            Juliano Viana
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development