Error with WixFilter

I have the product page, and a dataset on it, which dataset connects to the “stores” database from wixStores.And each time the page loads i get the url from the page and filter that url to the dataset to get the specific item of the database for this page.


So i verify that there is indeed such record in the database.


On the console.logs i get the correct slug(2nd line bmw-g310…)


But on the last console log(where i print the getcurrentitem) i get a null…
I am a bit confused because some days ago the code worked great…This is really weird.

I believe you need to move the url assignment statement inside the dataset’s onReady() function:

$w(“#dataset1”).onReady(() => {
let url = wixLocation.path[1];
… and so on …

Note: I haven’t tested this, but since the onReady() function is a handler, the context of the url variable might not be available.

If you continue to have problems, please post the URL of your site. Only authorized Wix personnel can get access to your site in the editor.

I hope this helps,

Yisrael

Hello Yisrael and thanks for helping me!
I tried having the url defined in the dataset onready, but nothing changed…
The biggest confusion i have is that before 3 days this code, was working, but now not…
Can you please take a quick look?

The page is “Product Page” of Wix Stores, and the code starts at line 25 untill 39.

Any luck?

No luck. I tried everything to no avail. To me this seems to be a bug and I’ve reported it to QA for evaluation.

Thank you!
I was so confused…like really this code worked 3 days ago…And now it didn’t…Made me crazy trying to figure out what is going on :stuck_out_tongue:
Thanks for checking!

NP - I’ve been playing with this on and off over the last couple of days and was completely baffled. I even took a string directly from the slug field of the collection and used that string directly for a filter - and it still didn’t work! I finally decided it wasn’t me being stupid (although maybe?) rather it appears to be a bug. Let’s see if QA can turn up something.

Yeah ikr!!!I too tried to hardcode the string there but it just wouldn’t work…it was at this point i knew somethin was gion on :stuck_out_tongue:
Is it possible when you get an answer from the QA team you let me know so that i can start editting again?

Hopefully I’ll remember to get back to you when I hear something.

Hey, Athanasios Spachos .
Is it still problem? I tried to reproduce the issue and had difficulties. Looks like everything works now (again).


If it is not, in your case, can you, please, configure a page where the issue is reproduced, save it and share the link?

Hey Jaroslavas!
Yep, just tested!Error is gone!Fixed!!

Yay! Hey Athanasios, glad this is working now. Kudos to Jaroslavas. :beers: