MultiSelect with sorting saves wrong data
If I have a many-to-many model relationship and I add a new related item to the selection (by clicking the 'Add' button) and then save the model the data that is saved save for the "new" item which it takes the next item out of the array of options prior to it being added. I may have tracked it down to almost a double initializing of the supercomboselect item. Has anyone else run into this sort of oddity?
Comments
https://github.com/daylightstudio/FUEL-CMS/commit/7f743339bb8e59084fabeaefd136764c1d57d229
[supercomboselect_search] =>
[undefined] => 77
[personnel] => Array
(
[0] => 39
[1] => 40
[2] => undefined
[3] => 25
)
[sorting_personnel] => %5B%2239%22%2C%2240%22%2C%2276%22%2C%2277%22%5D
[exists_personnel] => 1
what happens is I have a list where IDs 39 & 40 are already selected and then I add 1 or 2 more via the related model. So the 'sorting_personnel' field is right but the 'personnel' field is wrong and that's what appears to be used to save the data. Unfortunately if I use on_before or on_after hooks to set the 'personnel' to be the same values as sort_personnel (as an array) the ordering isn't actually set... I think the 'personnel' field is supposed to have the ordering