Displaying database content inside repeater not working

I have observed some issues around 10 days ago on my website, but I am not able to fix them.
The strange thing is that the code stopped to work, while before it was working. No changes to the code base has been done.

Situation:
On the website there is a multilingual database and I need to dynamically set the elements to the repeaters.

I took inspiration from some wix old thread ( https://www.wix.com/velo/forum/coding-with-velo/multilingual-database-working-method-place-in-this-thread ) and build the pages working.
Here there is the example of the code I used for setting the repeater properly:

import wixWindow from 'wix-window';
import { getExperience } from 'backend/getExperience.jsw'

let myLang = wixWindow.multilingual.currentLanguage;

$w.onReady(function () {
        getExperience(myLang).then((oTrails) => {
        $w("#repeater1").data = oTrails;
        $w("#repeater1").onItemReady(($w, itemData, index) => {
            $w("#text2").text = itemData.quickdescription;
            $w("#button36").label = itemData.title;
            $w("#button36").link = itemData.link;
            $w("#text6").text = itemData.quickLocation;
            $w("#text48").text = itemData.quickDuration;
            $w("#text5").text = itemData.quickAventureLevel;
            $w("#gallery1").items = itemData.gallery;
        });
        $w("#repeater1").show();
    });

});

The backend funcition getExperience performs a query on the database according to the set language.
This method worked properly until around 10 days ago, when I got some messages about the website not working anymore properly.
I then tried a lot of different solutions, and one according to this page https://www.wix.com/velo/forum/tips-tutorials-examples/how-to-display-your-database-content-in-a-repeater
Here the code used in my page:

import wixWindow from 'wix-window';
import { getTrails } from 'public/getTrails.js'

let myLang = wixWindow.multilingual.currentLanguage;
$w.onReady(function () {
    console.log("repeater data", $w("#repeater1").data);
    $w("#repeater1").onItemReady(($item, itemData, index) => {
        $item("#text2").text = itemData.quickdescription;
        console.log("quick descr", $item("#text2").text)
        $item("#button36").label = "Look Here Example!";
        $item("#button36").link = itemData.link;
        $item("#text6").text = itemData.location;
        $item("#gallery1").items = itemData.gallery;
        $item("#button30").link = itemData.link;
    });
    getTrails(myLang).then((oTrails) => {
          $w("#repeater1").data = oTrails;
    });
    $w("#repeater1").show();
});

What is not working at all is the onItemReady call after the .data assignment. It is not working at all!
I can see on the console log the print “quick descr”, with the $item(“#text2”).text value, but during the rendering those elements are not displayed at all. Strangely, the only element displayed is the button36 label properly according to the multilanguage databases value.
The queries are working properly, I can see the fetched items properly displayed on the console.

Again, till around 10 days ago the website was working perfectly.
This problem is causing a lot of issues and I need some support.

Try relocating the data assignment to the top, after the onReady() method, this line:

getTrails(myLang).then((oTrails) => $w("#repeater1").data = oTrails)

Hi Bruno, thanks for you answer.

There is no difference with your suggested change.
According to https://www.wix.com/velo/forum/tips-tutorials-examples/how-to-display-your-database-content-in-a-repeater , the .data assignment must stay after the onItemReady definition, in order to run the callback.

You are definitely right about that, cause the onItemReady() is only triggered after the data assignment. My mistake @albertocastella

Has anybody a hint?

This is quite a big issue for me. How can I contact someone from wix to get some support?

Consider the following code snippet:

import wixWindow from 'wix-window';
import { getTrails } from 'public/getTrails.js'

let myLang = wixWindow.multilingual.currentLanguage;
$w.onReady(function () {
    console.log("repeater data", $w("#repeater1").data);
    $w("#repeater1").onItemReady(($item, itemData, index) => {
        $item("#text2").text = itemData.quickdescription;
        console.log("quick descr", $item("#text2").text);
        $item("#button36").label = "Example!";
    });
    getTrails(myLang).then((oTrails) => {
        $w("#repeater1").data = oTrails;
    });
    $w("#repeater1").show();

});

This is a simplified version of what the code should look like.

As you can see, the only assigned objects are text2.text and buttonr36.label, with two different values.

Text2 takes the “quickdescription” value, while button36.label takes “Example!”. What is astonishing to me is that those assignment are not working, even if the console log displays correctly the value assigned to text2.
What I can see in Preview mode is the following:

What I can observe is that first onIteamReady is called. The console log is showing the message starting with “quick descr”. The issue is that the repeater gets populater with the dataset element AFTER the onItemReady call ([Dataset - Populated]: 'Accomodations" …
Is this the supposed behavior ?
If yes, the guide at page https://www.wix.com/velo/forum/tips-tutorials-examples/how-to-display-your-database-content-in-a-repeater is wrong.

I think I solved the issue, I’ll post more details here.