Hello,
when I try to save a repeater field with the following settings:
{
"fields": [
{
"type": "set",
"label": "Important Person",
"options": {
"fields": [
{
"type": "collectionlink",
"label": "Name",
"options": {
"link": "people",
"display": "name",
"multiple": false,
"limit": false
}
},
{
"name": "role",
"label": "Role",
"type": "text"
}
]
}
}
]
}
I'm getting a system error.
Ideally, I would like to be able on that field to select the person and from the person database to receive the name and surname which would populate the full name automatically in the form, next I would like to set the role of that person.
Thanks!
@panosru Do you have _people_ collection created? ("link": "people")
@Blistok of-course.... why would I post the issue without the collection? 馃槼


This seems to break (unhandled) when trying to link to nonexistent collection.
FWIW, I can't replicate on my end (latest next + config object you've posted). What's the system error?
@Blistok it just says system error

Could you point me in the right direction how to enable debug mode on cockpit so I could get the root of the issue?
Try enabling it in your config file:
'debug' => true
@Blistok Thanks! It wasn't documented :)
I got this:

And that is what I was posting:

This seems to be connected with mongo-php-driver, but I have no idea whether the error is on that side, or higher level in MongoDB PHP Library.
In any case the issue is caused by trying to write empty key to db here:

Sorry I can't help more.
@Blistok Thanks mate! You helped enough!
I noticed the empty key, I'll have to debug it and find out why it is empty...
@panosru I think the _name_ property is required (its value seems to be used as a key), so if it's not provided it's just gonna infer the empty string.
Try adding it wherever you have only _label_ (e.g. "label": "Important Person", "label": "Name") [it only needs to be unique if it's on the same level], and see if that fixes your issue.
@Blistok Don't you ever dare to say again "Sorry I can't help more"!

You're a genius!
Thanks mate!
Just hit this problem with GraphiQL which returns INTERNAL SERVER ERROR if a repeater with set returns an empty string.