Problem/Motivation
The bug. massageFormValues reads the order from the JS-maintained entity_ids hidden field, but when Drupal's AJAX button fires it doesn't trigger the form submit event — only the mouseup handler runs. More importantly, Drupal's core tableDrag always updates the weight number inputs when rows are dragged, and massageFormValues completely ignores those. The weight inputs are the authoritative source for order.
Proposed resolution
The fix adds a sort step: after decoding the entity IDs from the hidden field (which still handles add/remove correctly), it re-sorts them by the submitted weight values from items_table. The weight inputs are #type => 'number' elements submitted with every form POST, so they're always authoritative for drag order.
Comments
Comment #2
zeeshan_khan commentedhttps://git.drupalcode.org/project/inline_entity_form_dialog/-/merge_req... Fixes the issue
Comment #3
zeeshan_khan commentedComment #4
zeeshan_khan commentedFixed in 1.0.5