// If there is a file element, we need to flip a flag so later the
// form encoding can be set.
if (isset($element['#type'
]) &&
$element['#type'
] == 'file'
) { $form_state->
setHasFileElement();
} // Final tasks for the form element after self::doBuildForm() has run for
// all other elements.
if (isset($element['#type'
]) &&
$element['#type'
] == 'form'
) { // If there is a file element, we set the form encoding.
if ($form_state->
hasFileElement()) { $element['#attributes'
]['enctype'
] = 'multipart/form-data';
} // Allow Ajax submissions to the form action to bypass verification. This
// is especially useful for multipart forms, which cannot be verified via
// a response header.
$element['#attached'
]['drupalSettings'
]['ajaxTrustedUrl'
][$element['#action'
]] = TRUE;
// If a form contains a single textfield, and the ENTER key is pressed
// within it, Internet Explorer submits the form with no POST data
// identifying any submit button. Other browsers submit POST data as