URL Parameters disappear

A user get’s in the site with ?id=blabla attached to the URL.
Whenever i click on a menu link or programmatically move to another page with wixLocation.to("/someOtherPage"); i LOOSE the ?id=blabla.
Nothing was changed in the code for that to happen. It just started to happen. And now i can’t find a solution for it. Any ideas?
In the attached example, the /error page is loaded when there is no url parameter defined. In case someone wonders about that.

You should mark this as a bug and tag some admins.

In the meantime you can add the query back in where you need it to be present:

if (!wixLocation.url.includes(‘?query’) && session.getItem(‘shouldhaveQuery’)) $w(‘Button’).link = …

Yeah i did that as a temporary solution, but you can imagine i can’t even use the menus properly. So it’s a bit annoying.
I’ll see how to set this as a bug and tag an admin. Thank you for the suggestion David.

@gianni I avoid using menus and create my own :stuck_out_tongue: You can still set a session cookie in the meantime and it will work.

Hi,

The general internet convention says URL parameters should be erased when navigating between pages,
the bug that made url params remain when navigating was fixed.
You can use session cookies to keep track of the params instead.

Cheers,
Or

2 Likes

Thanks Or for your reply.
Is there any update post made by Corvid that explains this? For what i’ve been reading in the forum, the usual behavior for this (even though i understand keeping the URL parameters when navigation could cause unexpected events) was to have the url params remain.
For the people who was using that bug to their advantage they will have to re-write some chunks of code for their sites to work again.
At least i now know it was intentional and not a bug. Thankyou again!
Gianni

1 Like

@Or, we should be notified about such changes. I used some workaround to deal with this bug, and I didn’t know I can remove it.
And probably many users treated this bug as a feature and the fix broke their code.
How can we know about such changes?

2 Likes


https://www.wix.com/corvid/forum/community-discussion/urgent-passing-url-query-broken