lightbox code problem (after updates, maybe?)

Hi guys, need some help here. I have the following code bellow. It used to work fine, but now it simply stopped work. I imagine something changed between velo and corvid updating (?).

What it used to do was replicating information from repeater onClick to a LightBox. I got this code from Code Queen long ago by the way, but now I can’t eve find the original forum where she posted id.


$w.onReady(() => {
 let theItem = lightbox.getContext();  //
 let postID = theItem._id; // <-- here is where th  error happens with the "theItem._id" line
 
 $w("#importProds").setFilter(wixData.filter()
   .eq("_id", postID)  
  )
  .then(() => {
   console.log("Dataset is now filtered");
  })
  .catch((err) => {
   console.log(err);
  });

});

the debug says: “TypeError: Cannot read property ‘_id’ of undefined”

I thank you guys kindly for any help updating this code and hope I’m not repeating some question already answered, I did spent some time researching it to no success

What code do you have that opens the Lightbox? It appears that you are not passing any data since it says it’s “undefined”.

Yisrael, thanks for helping! There is the code I use in my page/repeater:

$w.onReady(() => {

    $w("#datasetProd").onReady(() => {

        $w("#repeaterProd").onItemReady(($item, itemData, index) => {
            $item('#imageProdGallery').onItemClicked(() => {
                let item = $item('#datasetProd').getCurrentItem();
                wixWindow.openLightbox('ProdEmb1', item)
            });
        });

    });

});	


(the code was build following Code Queen's instructon and has worked for  more than one year, then stopped recently without any modifications done in that period)

Not sure if this will help, but you might want to try…

Instead of this:

let item = $item('#datasetProd').getCurrentItem();
wixWindow.openLightbox('ProdEmb1', item)

Try this:

wixWindow.openLightbox('ProdEmb1', itemData)

If this doesn’t help, then bugs and system issues should be reported to Wix Customer Care.

Yeah, I have been trying to mess with things and make changes, but it really is not working anymore. I check sites form some freelance work I did int he past, total unrelated jobs, where I used the same code and the same thing is happenig there. I’ll try contacting the Customer Care as you suggested, thanks Yisrael.