1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Cannot Reproduce Unable to change $extraParams in route prefix

Discussion in 'Resolved Bug Reports' started by Jon W, Jan 8, 2014.

  1. Jon W

    Jon W Well-Known Member

    In the buildLink function in route prefixes, the $extraParams variable is passed by reference, but it doesn't actually appear to be able to be changed.

    It would be nice to be able to add/remove parameters from $extraParams in the route prefix. I assume this was the intention? If not, please move to suggestions.
     
  2. Lawrence

    Lawrence Well-Known Member

    Unless this has changed I use $extraParams in the route to send extra data to my controller: $extraParams['mydata'] = xxxxx
    return XenForo_Link::buildBasicLinkWithStringParam($outputPrefix, $action, $extension, $data, 'some_id', $extraParams);

    Then in the controllerPublic: $myData = $this->_input->filterSingle('mydata', XenForo_Input::STRING);
     
  3. Jon W

    Jon W Well-Known Member

    The querystring is handled by the XenForo_Link::buildPublicLink method, not the one you specified.
     
  4. Mike

    Mike XenForo Developer Staff Member

    I can't reproduce this. I added this to the thread prefix builder:
    Code:
    $extraParams['extra'] = 1;
    And all thread links had ?extra=1 appended.
     
  5. Jon W

    Jon W Well-Known Member

    Could be because I'm on a different computer, but I can't replicate this now either. :confused:

    Sorry for being a pain.
     

Share This Page