Will
Will

Reputation: 4705

How to enable more options for a DropDown Field in Silverstripe

I have a SilverStripe DropDown field, with CountryID:

DropDownField::create('CountryID', 'Country', Country::get()->map('ID', 'Name')->toArray())

The field is not showing the dropdown, instead it shows an input field with the ID in it and the text: "Too many related objects; fallback field in use"

How can I disable the fallback from happening. For eg, can I set the maximum number of related objects to a higer number, say 300?

Upvotes: 1

Views: 576

Answers (1)

Will
Will

Reputation: 4705

It is setable like this:

// mysite.yml

SilverStripe\ORM\FieldType\DBForeignKey:
  dropdown_field_threshold: 300  

Upvotes: 2

Related Questions