binda icon indicating copy to clipboard operation
binda copied to clipboard

Radio button has 2 choices

Open a-barbieri opened this issue 7 years ago • 1 comments

Expected behavior

I'd expect a Radio button to have 1 choice.

Actual behavior

Radio button has 2 choices.

How to reproduce the issue

The current issue happens on a repeater. Haven't tried on components.

  1. Create a structure with a repeater field with nothing in it.
  2. Create some components from that structure and add few repeater instances.
  3. Go back to the structure and create a new radio field inside the repeater
  4. Save and refresh
  5. Modify the radio field choices updating the temporary choice with a different name (say final choice with value final)
  6. Now open Rails console and select one component and get the choices related to the radio of the first repeater.
    Binda::Radio.where(
        field_setting_id: "your-radio-field-setting-id",
        fieldable_id: Binda::Repeater.where(
            field_setting_id: "your-repeater-field-setting-id", 
            fieldable_id: Binda::Component.where(structure_id: "your-structure-id").first
        )
    ).first.choices.map(&:value)
    # => ["final", "final"]
    

If then I assign a choice manually the same query returns just one value.

System configuration

Binda version: 0.1.9

Rails version: 5.1.4

a-barbieri avatar Jul 10 '18 13:07 a-barbieri

Apparently it's possible to assign multiple choices (as many as you wnat) via Rails Console. This shouldn't be possible...

a-barbieri avatar Jul 10 '18 14:07 a-barbieri