statamic / v2-hub

Statamic 2 - Feature Requests and Bug Reports
https://statamic.com
95 stars 5 forks source link

Custom suggestmode in Prestige Worldwide with max_items: 1 saves as an array instead of a string #2402

Closed Eworm closed 5 years ago

Eworm commented 5 years ago

Describe the bug I built a custom suggestmode for my Prestige Worldwide addon. The fieldtype has max_items: 1, looks like a dropdown, but saves the info as an array instead of a string.

To Reproduce Steps to reproduce the behavior:

  1. Install Prestige Worldwide and choose a collection in settings
  2. Go to an entry in the chosen collection and open the event info tab
  3. Scroll down to 'Signup form'
  4. Enable 'People can sign up for this event', and choose a form.
  5. Click on save

Expected behavior I expect the chosen value from the 'Which form should I use for signups?' select to save it's data as a string instead of an array, since it's max items is set to 1.

Screenshots If applicable, add screenshots to help explain your problem.

Environment details (please complete the following information):

Additional context I checked the repo of a site with my addon to see how the data was saved before, and it used to be saved as a string. The addon was working properly on a site of one of my clients, but it suddenly broke.