Settings not persisted when in edit form. This is probably the same fix as for the FieldGroup module...

Comments

kong’s picture

Also when I tried to "Add another item" with Field Collection containing an iToggle widget, the toggle stopped working.

DeFr’s picture

I needed iToggle to work with nested forms for a customer projet (using Inline Entity Form) so I've worked a bit on this, which should help all the modules that embeds a subform (IEF, Field Collection, …)

I think that patch is a step in the right direction, fix the problem completely with Inline Entity Form and makes the JS widget update the correct checkbox for Field Collection.

Specifically for Field Collection though, there's a few other problems that will need to be dealt with:

  • The fact that the hook_field_is_empty call always returns FALSE is gonna be painful for collections with a fixed number of items. In those cases, an item is only deleted when all the fields are empty ; this means that right now, you can't get rid of an item if your collection includes an iToggle field in those case.
  • After an AJAX call to add more items, the widget break, not sure why yet.
alexweber’s picture

Status: Active » Fixed

Thanks! Fixed: http://drupalcode.org/project/itoggle.git/commit/1a1fb43

Let's open further issues as follow-ups... Ideally i'd like to refactor iToggle to be a native Form API element and that would solve a lot of problems but I just don't have time to work on it at the moment...

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.