- Issue created by @maxmendez
- Status changed to Closed: won't fix
over 1 year ago 2:31pm 30 August 2023 - πΊπΈUnited States robphillips
Sorry, this feature request would overly complicate the already sensitive form validation system. There is a workaround, however. Use the hook system to add your own save button that sets the form as complete.
function hook_entity_form_steps_complete_form_alter(array &$form, FormStateInterface $form_state, FieldableEntityInterface $entity, array $state) { $form['actions']['save_immediately'] = [ '#type' => 'submit', '#name' => 'save_immediately', '#value' => t('Save'), ]; }
function hook_entity_form_steps_state_alter(array &$state, FormStateInterface $form_state, FieldableEntityInterface $entity) { if ($form_state->getTriggeringElement()['#name'] === 'save_immediately') { // Set form as complete to trigger the entity save operation. $state['complete'] = TRUE; } }
See https://git.drupalcode.org/project/entity_form_steps/-/blob/1.x/entity_f....
- π¨π·Costa Rica maxmendez
Hi @robphillips , thanks for your answer and time, i'll work around your suggestion.