// cause ID collisions with other forms on the page otherwise.
Html::
resetSeenIds();
} // If only parts of the form will be returned to the browser (e.g., Ajax or
// RIA clients), or if the form already had a new build ID regenerated when
// it was retrieved from the form cache, reuse the existing #build_id.
// Otherwise, a new #build_id is generated, to not clobber the previous
// build's data in the form cache; also allowing the user to go back to an
// earlier build, make changes, and re-submit.
// @see self::prepareForm()
$rebuild_info =
$form_state->
getRebuildInfo();
$enforce_old_build_id =
isset($old_form['#build_id'
]) && !
empty($rebuild_info['copy'
]['#build_id'
]);
$old_form_is_mutable_copy =
isset($old_form['#build_id_old'
]);
if ($enforce_old_build_id ||
$old_form_is_mutable_copy) { $form['#build_id'
] =
$old_form['#build_id'
];
if ($old_form_is_mutable_copy) { $form['#build_id_old'
] =
$old_form['#build_id_old'
];
} } else { if (isset($old_form['#build_id'
])) { $form['#build_id_old'
] =
$old_form['#build_id'
];
}