How to use autosave when form is called in twig

Created on 30 March 2023, over 1 year ago
Updated 6 April 2023, over 1 year ago

Problem/Motivation

Hi,
I want to use autosave for recording forms.
My forms are called in twig with twig-tweak cheat-sheet like this :

{{ drupal_entity_form('node', values={type: myForm }) }}

But the autosave is not working if I visit the content page with the form attached.
It works well when I visit directly the form.

Steps to reproduce

Proposed resolution

Is it possible to call autosave dynamically with code ?

Remaining tasks

User interface changes

API changes

Data model changes

Feature request
Status

Active

Version

1.4

Component

Entity form autosave

Created by

🇫🇷France zorax Monoblet

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @zorax
  • 🇫🇷France zorax Monoblet

    I change the loading of the form :

    $noeud_form = \Drupal\node\Entity\Node::create(['type' => $variables['formulaire']]);
    			  $formulaire_to_add = \Drupal::service('entity.form_builder')->getForm($noeud_form);
    			  $variables['formulaire_to_add'] = $formulaire_to_add;

    in twig : {{ formulaire_to_add }}
    How can I specify to autosave the form ?
    Regards,

Production build 0.71.5 2024