wixLocation APIs bug

Hi WIX team,

I’m observing some not clear behavior with wixLocation APIs, for me it looks like a bug.
The scenario for reproduction is as following:

  1. Get to page with some query parameters.
  2. Trigger change of query parameter value (or parameters list) by navigating to RELATIVE path: wixLocation.to(wixSite.currentPage.url + ‘?param=’ + parameter_value.toString()).
    Relative path is chosen to keep page content without change, but only update query value related content.
  3. Get current wixLocation.url or wixLocation.query[‘param’]
  4. Observe that the values from the step 3 correspond to url and query before the change (step 1)

The reproduction may be found here:
https://dmitrybi32.wixsite.com/reproduce

By pressing the button on the main screen, it will navigate to the page with query parameter.
On that page there are 2 buttons:
First for displaying current url and query parameters values using wixLocation APIs.
The second button used to update the parameter of the query by navigating to same page with relative path.

I’ll appreciate WIX team to take a look at this issue.

Thanks,
Dima

3 Likes

Hi Dima,

I looked into the problem and it does look like a bug, I passed it to the relevant team.
Until a solution is deployed you can workaround this problem by using absolute URL instead of relative.

Thank you for the detailed report,
Or