Text box error?

Hey,

I am new to WIX collections. I am getting this error message “Failed setting text: TypeError: Cannot read property ‘constructor’ of null”.

The field in my collection is a blank Date/time field. It will only be used sometimes.

How can I stop this message?

Null normally means that there is nothing there, so basically you have a blank field in your dataset or your dataset isn’t ready yet or you have no match in your dataset.

Have a read of this from the api section.
https://www.wix.com/corvid/reference/wix-dataset.Dataset.html#getCurrentItem

Also, make sure that you sync your dataset if you’ve been working in the sandbox.
https://support.wix.com/en/article/syncing-data-between-sandbox-and-live-database-collections

1 Like

Thanks for your help it turns out I needed to publish my site. If you add a new field to a collection and then sync the collection to Live, the new fields don’t copy to the LIVE collection until you have published the site.

So I wasn’t able to connect to the fields in my repeater until I published my site. Not a great feature WIX!

@1425club66601 Why do you feel this is a problem? Changes made in the sandbox site don’t go live until the site is published. That applies to pages, code, and the database collection. You don’t want these changes applied automatically as they could potentially break the Live site. The idea is that changes are made to the site, and once the owner/developer is satisfied, the changes are published.

1 Like

@1425club66601

Have a read of this page, it will explain fully what Yisrael is talking about above.
https://support.wix.com/en/article/accessing-your-sandbox-and-live-database-collections

Like he says, it isn’t a flaw or a design fault or a missing feature with Wix, it is setup like this to protect you and your site and means that you have a safe working environment to use that you can change and test your site in whilst the public user still sees your existing and working site until you are happy and save and publish any changes to it.

Not wanting to sound horrible here, however I can probably guess that you and a lot of other users would be moaning to Wix too if it was the other way around and you had just changed your website and it had stopped working and the sandbox to live feature was not implemented.

It feels like sometimes Wix can’t win whatever they do!

1 Like