SOLVED - Error gallery stop work

e had a gallery that uploaded his images through a data collection,
I used the following code that in this forum kindly someone shared,
Now I stop working on 2 pages where I used the same kind of code,
Did something change in corvid?

I appreciate your guidance.

$w.onReady(function () {
let item = $w("#dynamicDataset").getCurrentItem();
$w("#gallery1").items = [
{ src: item.imagenPrincipal },
{ src: item.image_1 },
{ src: item.image_2 },
{ src: item.image_3 },
{ src: item.image_4 },
{ src: item.image_5 }
];

});

I I seem to be having the same problem started about 2.5 hrs ago. The gallery has been working fine for 18 months with no changes to the code … then it just stopped. Has anything changed?

Here’s the code, … I got from the forums … yes it’s a bit crude but I don’t do this for a living … it works … well it use to.

import wixData from β€˜wix-data’;
$w.onReady( function () {
let pic1 = $w(β€œ#dynamicDataset”).getCurrentItem().pic1;
let pic2 = $w(β€œ#dynamicDataset”).getCurrentItem().pic2;
let pic3 = $w(β€œ#dynamicDataset”).getCurrentItem().pic3;
let pic4 = $w(β€œ#dynamicDataset”).getCurrentItem().pic4;
let pic5 = $w(β€œ#dynamicDataset”).getCurrentItem().pic5;
let pic6 = $w(β€œ#dynamicDataset”).getCurrentItem().pic6;
let pic7 = $w(β€œ#dynamicDataset”).getCurrentItem().pic7;
let pic8 = $w(β€œ#dynamicDataset”).getCurrentItem().pic8;
let pic9 = $w(β€œ#dynamicDataset”).getCurrentItem().pic9;
let pic10 = $w(β€œ#dynamicDataset”).getCurrentItem().pic10;
let pic11 = $w(β€œ#dynamicDataset”).getCurrentItem().pic11;
let pic12 = $w(β€œ#dynamicDataset”).getCurrentItem().pic12;
let pic13 = $w(β€œ#dynamicDataset”).getCurrentItem().pic13;
let pic14 = $w(β€œ#dynamicDataset”).getCurrentItem().pic14;
let pic15 = $w(β€œ#dynamicDataset”).getCurrentItem().pic15;
let pic16 = $w(β€œ#dynamicDataset”).getCurrentItem().pic16;
let pic17 = $w(β€œ#dynamicDataset”).getCurrentItem().pic17;
let pic18 = $w(β€œ#dynamicDataset”).getCurrentItem().pic18;
let pic19 = $w(β€œ#dynamicDataset”).getCurrentItem().pic19;
let pic20 = $w(β€œ#dynamicDataset”).getCurrentItem().pic20;
$w(β€œ#gallery1”).items = [ { src: pic1, }, { src: pic2, }, { src: pic3, }, { src: pic4, }, { src: pic5, }, { src: pic6, }, { src: pic7, }, { src: pic8, }, { src: pic9, }, { src: pic10, }, { src: pic11, }, { src: pic12, }, { src: pic13, }, { src: pic14, }, { src: pic15, }, { src: pic16, }, { src: pic17, }, { src: pic18, }, { src: pic19, }, { src: pic20, }];

});
$w.onReady(() => {
$w(β€œ#dynamicDataset”).onReady(() => {
let items = $w(β€œ#dynamicDataset”).getCurrentItem().morePics;
if (items === yes) {
$w(β€œ#button13”).show();
} else {
$w(β€œ#button13”).hide();
}
});
});

1 Like

Maybe something is broken on wix?

pic 7 line has a code error or may be a bad copy and paste.

I wonder if WIX deprecated something that breaks this code.

regarding pic 7 error … thanks … but I don’t see … probably starring right at it.

1 Like

was the traductor eliminate a word, sorry.

if this code is no longer supported, is there any other method to do the same thing? Hopefully we won’t have to resort to that …

1 Like

yup same errors here i have posted this in two other post regarding this issue i get a

typeError: cannot read property β€˜_id’ of null

1 Like

apparently many people are having problems, can someone guide us to know if it is something of the code or if it is the WIX platform?

the problem was code, the data set must be invoked within this code.

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

})

A beginner’s problem …

in my case, it’s been working for 18 months … why did it stop working?

Show your code…

my code works for 3 months

it’s posted above

Try this code…


import wixData from 'wix-data';

$w.onReady(function () {

$w("#dataset").onReady(() => {
let pic1 = $w("#dynamicDataset").getCurrentItem().pic1;
let pic2 = $w("#dynamicDataset").getCurrentItem().pic2;
let pic3 = $w("#dynamicDataset").getCurrentItem().pic3;
let pic4 = $w("#dynamicDataset").getCurrentItem().pic4;
let pic5 = $w("#dynamicDataset").getCurrentItem().pic5;
let pic6 = $w("#dynamicDataset").getCurrentItem().pic6;
let pic7 = $w("#dynamicDataset").getCurrentItem().pic7;
let pic8 = $w("#dynamicDataset").getCurrentItem().pic8;
let pic9 = $w("#dynamicDataset").getCurrentItem().pic9;
let pic10 = $w("#dynamicDataset").getCurrentItem().pic10;
let pic11 = $w("#dynamicDataset").getCurrentItem().pic11;
let pic12 = $w("#dynamicDataset").getCurrentItem().pic12;
let pic13 = $w("#dynamicDataset").getCurrentItem().pic13;
let pic14 = $w("#dynamicDataset").getCurrentItem().pic14;
let pic15 = $w("#dynamicDataset").getCurrentItem().pic15;
let pic16 = $w("#dynamicDataset").getCurrentItem().pic16;
let pic17 = $w("#dynamicDataset").getCurrentItem().pic17;
let pic18 = $w("#dynamicDataset").getCurrentItem().pic18;
let pic19 = $w("#dynamicDataset").getCurrentItem().pic19;
let pic20 = $w("#dynamicDataset").getCurrentItem().pic20;

$w("#gallery1").items = [ { src: pic1, }, { src: pic2, }, { src: pic3, }, { src: pic4, }, { src: pic5, }, { src: pic6, }, { src: pic7, }, { src: pic8, }, { src: pic9, }, { src: pic10, }, { src: pic11, }, { src: pic12, }, { src: pic13, }, { src: pic14, }, { src: pic15, }, { src: pic16, }, { src: pic17, }, { src: pic18, }, { src: pic19, }, { src: pic20, }];
})
});
$w.onReady(() => {
$w("#dynamicDataset").onReady(() => {
let items = $w("#dynamicDataset").getCurrentItem().morePics;
if (items === `yes`) {
$w("#button13").show();
} else {
$w("#button13").hide();
}
});
});

I already modified with another work around - even less elegant than before … but it works. I’ll make the mods you recommend this weekend. Thanks!

1 Like