Ingredients do not resort when weights are changed or rows are dragged.
Code problem is in function recipe_ingredient_autocomplete_validate:
// Try to find an iid with a name matching the entered ingredient name.
// recipe_ingredient_id_from_name() creates the ingredient if not found.
$value = array(
'quantity' => $element['quantity']['#value'],
'unit_key' => $element['unit_key']['#value'],
'iid' => recipe_ingredient_id_from_name($name),
'name' => $name,
'note' => $element['note']['#value'],
'_weight' => $element['_weight']['#value'], <= this is missing
);
If someone can help me out with the procedure for correcting (github pull request, patch creation) I can help out.
Comments
Comment #2
tim_wgbh commentedComment #3
dcam commentedThanks for offering to write a patch, but I took care of it. Also, thanks for the report. I guess I thought that the Field API would take care of the weights. Clearly I haven't done a lot of ingredient re-ordering.
I'm going to let Testbot check the patch, then I'll commit it. I don't expect there to be any errors. I really should write a test for this, but I'm feeling lazy.
Comment #5
dcam commentedI committed the patch. I gave you the commit credit, @tim_wgbh.