Problem/Motivation

I am using the patch on #2757491: Allow Webforms to be submitted using AJAX to try submitting a webform through ajax. It is a very simple email subscribe form and the first thing I noticed is that the thank you message were not being displayed properly. I check the code on the patch and I think the issue belongs more to the webform. Its state is always UNSAVED for webforms that have it's results disabled.

Proposed resolution

I am removing that state (STATE_UNSAVED) altogether. It's not being really used and it could be pulled from the ->id() itself.

Comments

hanoii created an issue. See original summary.

hanoii’s picture

Status: Active » Needs review
StatusFileSize
new1.76 KB
hanoii’s picture

Status: Needs review » Needs work

The last submitted patch, 2: webform-remove_state_unsave-2883894-2.patch, failed testing.

hanoii’s picture

It's failing because now the form that disables webforms are properly set as completed and then generates a token.

I wonder if this is OK and the tests needs to be fixed, or you'd think this patch is wrong?

For me it seems ok that a non-saved form is still 'completed'.

jrockowitz’s picture

I think we need to track if a submission is unsaved because the saving of results can be disabled.

hanoii’s picture

The problem I faced with AJAX was exactly because of the results being disabled.

The way this is done an unsaved form is never completed.

jrockowitz’s picture

I am not following the issue here.

Can you please post an example of a form with this problem.

jrockowitz’s picture

Status: Needs work » Closed (cannot reproduce)