Drupal module autosave_webform

Drupal module for automaticlly save drafts of a webform in Drupal.

This module saves an open instance of a webform automaticly in the database. When the user does not complete the form but does come back at a later moment the webform is prefilled with the data entered previously.

This module does the same thing as the module Form Save State but instead of saving the data into the browsers data store it saves the data in the drupal database. This way we can assure that the user still has the data available when he or she logs in from another computer.

Technical documentation

If you want to implement the auto save functionality in your own module you have the implement the following hooks:

hook_autosavewebform_alter_autosaving_forms
hook_autosavewebform_restore_alter
hook_autosavewebform_save_alter

See autosave_webform.api.php for more information.

Git clone

git clone --branch 7.x-1.x https://git.drupal.org/sandbox/jaapjansma/2648850.git

Comments

jaapjansma created an issue. See original summary.

jaapjansma’s picture

Our senior experts (all volunteers) share hands-on business knowledge with organisations in developing countries and emerging markets, taking away bottle necks, and facilitating sustainable paths for growth.

jaapjansma’s picture

PA robot’s picture

Status: Needs review » Needs work

Git clone command for the sandbox is missing in the issue summary, please add it.

We are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and put yourself on the high priority list, then we will take a look at your project right away :-)

Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).

I'm a robot and this is an automated message from Project Applications Scraper.

jaapjansma’s picture

The git clone command is:

git clone --branch 7.x-1.x https://git.drupal.org/sandbox/jaapjansma/2648850.git

jaapjansma’s picture

Issue summary: View changes
Status: Needs work » Needs review
tobias.streefkerk’s picture

Hello,

Great idea!

Did you consider putting your module through automated testing: pareview.sh.
It would also be nice if you put a folder name behind your git clone command.
Also consider updating the description in your .info file to make it more user friendly - they should know instantly what you mean.

PA robot’s picture

Status: Needs review » Needs work

There are some errors reported by automated review tools, did you already check them? See http://pareview.sh/pareview/httpgitdrupalorgsandboxjaapjansma2648850git

I'm a robot and this is an automated message from Project Applications Scraper.

jaapjansma’s picture

Status: Needs work » Needs review

I have updated the code to match the review

anishnirmal’s picture

Hi jaapjansma,
autosave_webform.js
It found function autosave_webform_hide_save_message at line 121 is defined but never used.

thirstysix’s picture

Hi jaapjansma,
I installed Webform 7.x-4.12 version and autosave_webform sandbox module. once, i fill the values it saved in the database table autosave_webform_forms. but these values didn't show in the webform fields after page refresh. It shows the below error.

Warning: Invalid argument supplied for foreach() in WebformConditionals->getChildrenMap() (line 280 of /var/www/html/drupal741/sites/all/modules/webform/includes/webform.webformconditionals.inc).
Notice: Trying to get property of non-object in WebformConditionals->executeConditionals() (line 337 of /var/www/html/drupal741/sites/all/modules/webform/includes/webform.webformconditionals.inc).
Notice: Trying to get property of non-object in WebformConditionals->executeConditionals() (line 338 of /var/www/html/drupal741/sites/all/modules/webform/includes/webform.webformconditionals.inc).
Notice: Trying to get property of non-object in webform_client_form_pages() (line 3220 of /var/www/html/drupal741/sites/all/modules/webform/webform.module).

jaapjansma’s picture

@Anishnirmal It is right that the function is never used in the js file. However the function is fired after the ajax submit handler returns from Drupal.

@satheeshkhumar thanks for reporting the issue with conditionals. I will check how to solve that.

jaapjansma’s picture

Status: Needs review » Active
jaapjansma’s picture

Status: Active » Needs review

@satheeshkhumar I have fixed the notices.

pankajsachdeva’s picture

Issue summary: View changes
pankajsachdeva’s picture

Automated Review

Found some issues on pareview.sh. You can follow this link : http://pareview.sh/pareview/httpgitdrupalorgsandboxjaapjansma2648850git

pankajsachdeva’s picture

Status: Needs review » Needs work
klausi’s picture

Status: Needs work » Needs review

That minor coding standard issues are surely not application blockers, anything else that you found or should this be RTBC instead?

pankajsachdeva’s picture

This module also works for the anonymous users and makes AJax calls repeatedly after some time. I think this is not the desired behaviour of this module. As mentioned aboe in the description, its for the authenticated users to prefill data in webform when he/she logs in from different machine.
When I was testing this module, I got some error message :
  1. Notice: Undefined index: #token in autosave_webform_restore() (line 140 of /Applications/MAMP/htdocs/fresh-drupal/sites/all/modules/2648850/autosave_webform.module).
  2. Also get Ajax error repeatedly some time when login from another browser:

    An AJAX HTTP request terminated abnormally.
    Debugging information follows.
    Path: /system/ajax
    StatusText: n/a
    ResponseText:
    Fatal error: Call to undefined function autosave_webform_form_submit() in /Applications/MAMP/htdocs/fresh-drupal/includes/form.inc on line 1519
    ReadyState: undefined

pankajsachdeva’s picture

Status: Needs review » Needs work
PA robot’s picture

Status: Needs work » Closed (won't fix)

Closing due to lack of activity. If you are still working on this application, you should fix all known problems and then set the status to "Needs review". (See also the project application workflow).

I'm a robot and this is an automated message from Project Applications Scraper.