button broken due to fix various problems when using form storage

fago - August 31, 2008 - 12:41
Project:Drupal
Version:6.15
Component:forms system
Category:bug report
Priority:critical
Assigned:sun
Status:reviewed & tested by the community
Issue tags:D7 Form API challenge, drupal-6.16-blocker
Description

Currently $form_state['storage'] is intended to be set in a #submit callback. So when creating a multistep form you can put your stuff into $form_state during the form build, then populate the storage during #submit.

This works fine, but when you start to add some #ahah stuff to the form, #cache will be set and the form will be cached when it's loaded the first time. As an affect the #submit callback is called
* without an initialized $form_state, as the form got cached through #cache
* without a form storage, as it wasn't set yet
So there is no way to make use of the $form_state apart from setting $form_state['storage'] during the form build. However currently this isn't intended and doesn't work well, because when you do it
* the form is immediately rebuilt even when it's loaded the very first time
* $form is written two times into the cache, once due to the storage and once due to #cache

To solve this I'd propose support setting the form storage during form build and fix the two mentioned issues. If there is an agreement that this is the way to solve it, I'd do a patch.

Note: This issue applies to 6.x too.

#1

fago - September 1, 2008 - 10:14
Title:form storage doesn't work well on cached forms» fix various problems when using form storage

Furthermore there is another related issue: When the storage is already set and there is a validation error, the form is rebuilt nevertheless! So when one uses a multistep form and saves stuff into the storage with the submit callback, then in this case the submit callbacks are skipped due to the validation error and the form is rebuilt without an updated storage, so any changes are lost.

So I've done a patch which fixes these problems:
* It makes sure the form storage lets the form rebuild only when the form has been submitted and there are no validation errors.
* It also saves the form storage to the cache table when #cache is activate by #ahah properties or something else.

These simple fixes now make it possible to
* put your thingie to edit into the form storage during the initial form build
* to update your thingie after each step out of a #submit callback
- which I'd consider as typical usage.

Furthermore now it's no problem to use the form storage together with #cache.

Note that I've tested the changes with a complex case - the rules admin UI for d6. It's a multistep form using storage which might have some #ahah properties in there - with this patch the form runs fine!

It applies to d7 and d6.

AttachmentSizeStatusTest resultOperations
drupal_form_multistep_troubles.patch1.18 KBIdleFailed: Failed to apply patch.View details | Re-test

#2

fago - September 1, 2008 - 10:16

I think it would make sense to write a test for a multistep form using storage and #cache in d7 - however I'm not sure how to do it. Is there a way to add a testcase-module containing such a form just for testing?

#3

Damien Tournoud - September 1, 2008 - 10:38

I just created a book page about our mock modules. Please see http://drupal.org/node/302577

#4

fago - September 1, 2008 - 13:42
Status:active» needs review

ah thanks!

ok, so I've written some tests using a mock module. The module provides a multistep form using storage and optionally #cache. Then the tests ensure that
* the storage properly stores the values
* the form builders aren't called too often
* the storage keeps working, when #cache is activated
* the form values are kept when an validation error occurs.

attached is a patch containing *only* the tests. Make sure to have the patch from #1 included or some tests will fail.

AttachmentSizeStatusTest resultOperations
drupal_form_storage_tests_7.patch5.91 KBIdleFailed: 7240 passes, 3 fails, 0 exceptionsView details | Re-test

#5

Robin Monks - September 1, 2008 - 14:13
Status:needs review» reviewed & tested by the community

Test patch and issue patch apply file, and the FormsAPI simpletest runs correctly (88 passes, 0 fails, 0 exceptions).

Robin

#6

moshe weitzman - September 2, 2008 - 13:08
Status:reviewed & tested by the community» needs review

@Robin - please slow down. Significant FAPI changes need review from Eaton or chx.

#7

chx - September 2, 2008 - 18:25

The second hunk is a bugfix -- you can have storage populated from a previous step and then a validate error will get the form rebuilt still. Whether we want the builder to be able to populate storage I am less sure. I am open to what Eaton says :)

#8

fago - September 2, 2008 - 20:45

thanks chx.

>Whether we want the builder to be able to populate storage I am less sure. I am open to what Eaton says :)
I'd call this a bug making $form_state unusable, as it requires one to use $form for storing values instead when caching by #cache should work too.

Anyway when putting stuff into the storage during build is not supported, the first hunk makes no difference either. It's unnecessary to pass NULL to form_set_cache when there is no storage.

#9

dropcube - September 17, 2008 - 15:49

I had posted a similar patch in other issue #291939: Multistep forms should not be rebuilt if there are validation errors. because I did not found this one.

Making sure the form storage lets the form rebuild only when there are not validation errors fixes the bugs reported and work Ok form me.

Anyway when putting stuff into the storage during build is not supported

Could you explain why this is not supported. I have some use case where is required to put stuff into the storage during the form builder function. Is there an alternative way to do this?

#10

fago - October 4, 2008 - 12:29

>Anyway when putting stuff into the storage during build is not supported, the first hunk makes no difference either. It's unnecessary to pass NULL to form_set_cache when there is no storage.

Anyway, I think putting stuff into storage during build *should* be supported. Currently it's not, but nobody knows. It's not documented and as it's useful people do - yes, I have seen several cases where people do so. Then some days ago I held a copy of the latest pro drupal development book in my hands - even the multistep form example in there sets $the storage in $form_state during the form build!

@dropcube: What happens when you populate the storage during form build currently?
* the form is immediately rebuilt even when it's loaded the very first time. So the builder runs 2x when the form is shown the first time.
* When #cache gets set, $form is written two times into the cache, once due to the storage and once due to #cache.

To summarize this simple patch
1. It fixes validation for multistep forms (prevent the rebuild!)
2. It fixes issues when populating form storage during form build

Furthermore thanks to the fix of point 2, it makes it possible to use the form storage in a clean way even when #cache gets activated. See post #1.

Imo the patch from #1 is an important patch which should get into d7 and d6! For d7 there is also a test (#4).

#11

Wim Leers - October 4, 2008 - 13:06

Subscribing.

#12

sun - October 4, 2008 - 15:21
Status:needs review» needs work

Can we add some inline comments explaining the how's and why's of the enhanced condition?

#13

fago - October 5, 2008 - 11:30
Status:needs work» needs review

ok, I've updated the patch.

Furthermore I've improved it a bit: When $form_state['rebuild'] is explicitly set, now it's too checked whether the form has been submitted and validation errors occured. It doesn't make sense to allow people skipping this check, so I've improved the patch to check it for both cases. As an affect you can set $form_state['rebuild'] in your form builder now too.

Updated and improved patch from #1 attached, applies to d6 & d7. The test for d7 (#4) still works fine once the patch is applied.

AttachmentSizeStatusTest resultOperations
drupal_form_state_update_7.patch1.9 KBIdleFailed: Failed to install HEAD.View details | Re-test

#14

dropcube - October 5, 2008 - 13:40

The patch looks good for me. I tested and it prevents that forms that contains validation errors get rebuild during a multi-step process. The Form API docs should be updated to clearly explains the workflow.

#15

System Message - November 16, 2008 - 21:45
Status:needs review» needs work

The last submitted patch failed testing.

#16

lilou - November 17, 2008 - 13:29

#17

sun - December 4, 2008 - 02:04

Re-test.

AttachmentSizeStatusTest resultOperations
drupal_form_state_update_7.patch1.9 KBIdleFailed: Failed to apply patch.View details | Re-test

#18

rb7 - December 8, 2008 - 21:08

Subscribing.

#19

bilgehan - December 26, 2008 - 18:56

Subscribing.

#20

Damien Tournoud - December 30, 2008 - 01:50
Status:needs review» needs work

Those two fixes looks reasonable at first sight. The test in #4 should be rolled in the patch (so that it can be tested by the test bot). There is some code style convention issues there (please see the Test writers guidelines for details). Plus I would like to be sure that the test cover both hunks (ie. it should break when any of them is not applied).

#21

doq - April 11, 2009 - 09:45

Subscribing.

#22

fago - April 15, 2009 - 14:43
Status:needs work» needs review

so, next try.

* I've updated the patch, as the form api received some improvements in the meanwhile.
* I took a look at the test writer guidelines (thanks damien) and overhauled the test. The test already covers both hunks.
* Attached is the updated patch for d7, containing the both, the changes and test.

AttachmentSizeStatusTest resultOperations
form_storage_d7_v2.patch7.19 KBIdleFailed: Failed to apply patch.View details | Re-test

#23

Dries - April 17, 2009 - 20:37

Some feedback:

- We use dashes instead of underscores for menu/url paths. form_test/form_storage should be form-test/form-storage.

- The test case looks OK but took me some time figuring out. Some additional documentation would have helped. I wonder if the test could be simplified.

- In testFormCached() why don't we pass array('query' => 'cache=1') to both calls to drupalPost()? It seems like that could make for a better test.

Let's get this patch in!

#24

fago - April 21, 2009 - 20:49

thanks.

The exiting menu items of the already existing form-API test use the path "form_test" - so I stayed with form_test for consistency, but fixed it to use form_test/form-storage. So probably form_test should be fixed there to be form-test for all those menu items, but that's another issue..

>In testFormCached() why don't we pass array('query' => 'cache=1') to both calls to drupalPost()? It seems like that could make for a better test.

It doesn't matter the second time, as the form is already cached and won't be constructed again. But yes, it's more logical to add it to the second call too, so I've done so.

>Some additional documentation would have helped. I wonder if the test could be simplified.

Unfortunately I can't think of a way simplifying the test. Multistep forms with form storage aren't that simple ;) However I added some more comments to the form and the tests. I also improved the language to talk about "form constructions" not "form builds", as form builds could be easily confused with the build of form_builder(), which is happening for cached forms too and isn't counted.

AttachmentSizeStatusTest resultOperations
form_storage_d7_3.patch7.95 KBIdleFailed: Failed to apply patch.View details | Re-test

#25

fago - April 21, 2009 - 20:55

I forgot to rename the counting "builds" variable too, fixed that.

AttachmentSizeStatusTest resultOperations
form_storage_d7_3.patch7.98 KBIdleFailed: Failed to apply patch.View details | Re-test

#26

Dries - April 22, 2009 - 09:13
Status:needs review» fixed

Code looks good, fixes a real problem, comes with tests and documentation. Excellent work. Committed to CVS HEAD. Thanks fago.

#27

fago - April 23, 2009 - 13:55
Version:7.x-dev» 6.x-dev
Status:fixed» needs review

yeah, thanks!

So let's backport this to 6.x? The patch from #13 still applies fine to d6 and it's the same fix as got committed in d7.

#28

Alan D. - June 9, 2009 - 00:02

Thanks fago, the patch from #13 is working nicely on my local Drupal 6.12 install.

Is this still on the cards for a back port?

#29

John Morahan - July 29, 2009 - 11:54
Status:needs review» reviewed & tested by the community

#13 still applies and still works for me on 6.x-dev.

#30

Gábor Hojtsy - September 14, 2009 - 09:27
Status:reviewed & tested by the community» fixed

Committed to Drupal 6 too, thanks.

#31

dww - September 17, 2009 - 06:26

Not sure if it's because project_issue's comment handling is doing something unholy and relying on the bug that this fixed, but deploying this change on d.o broke issue comment previews. See #579900: Previewing comments is broken by FAPI change in Drupal core 6.14. I don't have time to dig much deeper (I've got a massive deadline this weekend), other than narrowing it down to this API change as the source of the problem. I haven't even read this issue yet or studied the patch. But, if anyone familiar with this change is willing/able to take a look at issue comment previews, that'd be great... Thanks!

#32

mattyoung - September 17, 2009 - 07:17

subscribe

#33

chx - September 22, 2009 - 23:15
Title:fix various problems when using form storage» button broken due to fix various problems when using form storage
Status:fixed» active

!empty($form_state['submitted']) && !form_get_errors() <= why is form_state['submitted'] there? the !form_get_errors yeah but the submitted check broke buttons as dww shows.

#34

dww - September 22, 2009 - 23:20

To clarify, by "buttons" we mean FAPI form elements of #type 'button', like core's "Preview" button on comment forms...

#35

sun - September 22, 2009 - 23:57
Version:6.x-dev» 7.x-dev
Priority:normal» critical
Status:active» needs review

yeah, looks wrong.

However, comment previews are working in HEAD, so this doesn't seem to be covered by tests.

AttachmentSizeStatusTest resultOperations
drupal.form-button-submit.patch812 bytesIdleUnable to apply patch drupal.form-button-submit.patchView details | Re-test

#36

dww - September 22, 2009 - 23:59

comment previews are working in D6, too. Core comment previews do *not* require rebuilding the form (and in fact, you break the preview if you rebuild the form). what's broken are forms that use #type 'button' to trigger something that requires the form to rebuild. But right, that might not be tested in D7, either...

#37

sun - September 23, 2009 - 00:06

Like that? Not sure.

AttachmentSizeStatusTest resultOperations
drupal.form-button-submit.36.patch4.57 KBIdleUnable to apply patch drupal.form-button-submit.36.patchView details | Re-test

#38

sun - September 23, 2009 - 00:09

#type = button.

AttachmentSizeStatusTest resultOperations
drupal.form-button-submit.38.patch4.67 KBIdleUnable to apply patch drupal.form-button-submit.38.patchView details | Re-test

#39

dww - September 23, 2009 - 00:13
Status:needs review» needs work

In terms of the new test in #38 -- no, I think we really want to test both #type == 'submit' and 'button', not one or the other. So long as both exist in FAPI (and API bug IMHO, but whatever), we should test both properly for this case.

#40

dww - September 23, 2009 - 00:14

p.s. I know you love to clean up every file you touch, but all the whitespace and code style fixes make this patch harder to read. ;) Can't we do that stuff in separate issues? *shrug* Either way, thanks for fixing them. ;)

#41

grendzy - September 28, 2009 - 16:41

This change also broke multistep forms in Drupal 6.14. If '#button' is used, $form_state['values'] is empty.

#42

boombatower - September 30, 2009 - 03:00

#43

Frank Steiner - October 9, 2009 - 06:50

This is really serious for 6.14! E.g. the biblio module stopped working after upgrading from 6.13 to 6.14. The patch in http://drupal.org/node/591696 makes it working again, so I can get around this, but I guess there should be an official patch for 6.14.

#44

Gábor Hojtsy - October 9, 2009 - 06:54

Tagging

#45

bjcool - October 9, 2009 - 08:23

+

#46

mrfelton - October 9, 2009 - 16:33

Which patch should I apply to 6.14 to fix this?

#47

Frank Steiner - October 20, 2009 - 13:17

The one from #43 works for our 6.14.

#48

mikeytown2 - November 11, 2009 - 18:45

Does this fix the bug where button D was pressed but the function for button A was called instead? For 6.14

#49

wesku - November 17, 2009 - 15:20

This multistep form bug also effects a custom module that we have for a customer site. Looking for ways of working around it currently.

#50

sun - November 17, 2009 - 16:06
Assigned to:Anonymous» sun
Status:needs work» needs review
AttachmentSizeStatusTest resultOperations
drupal.form-button-submit.50.patch5.92 KBIdleFailed on MySQL 5.0 ISAM, with: 14,908 pass(es), 3 fail(s), and 0 exception(es).View details | Re-test

#51

System Message - November 17, 2009 - 16:21
Status:needs review» needs work

The last submitted patch failed testing.

#52

sun - November 17, 2009 - 18:19
Status:needs work» needs review

Fixed the tests.

AttachmentSizeStatusTest resultOperations
drupal.form-button-submit.52.patch6.47 KBIdleUnable to apply patch drupal.form-button-submit.52.patchView details | Re-test

#53

fago - November 18, 2009 - 09:20
Status:needs review» needs work

ouch, um, my fault :( I'm sry for that.

@patch:
The fix looks good. However the number of form constructions should be 1 less for the version with cache activated. I think you are testing it both times without having #cache activated as you are missing the query parameter for the GET call.

#54

sun - November 18, 2009 - 19:18
Status:needs work» needs review

+++ modules/simpletest/tests/form_test.module 17 Nov 2009 18:17:55 -0000
@@ -297,8 +297,10 @@ function form_storage_test_form($form, &
     $form_state['storage'] += array('step' => 1);
   }
+  // Output how often this form has been constructed.
+  drupal_set_message('Form constructions: ' . $_SESSION['constructions']);

-  // Count how often the form is constructed
+  // Count how often the form is constructed.
   $_SESSION['constructions']++;

uhm - are you sure?

It counts the number of constructions in a session variable - not the number of submitted steps or cached rebuilds or whatever.

This review is powered by Dreditor.

#55

fago - November 19, 2009 - 12:54
Status:needs review» needs work

Right, it counts how often the form constructor is called. But this depends whether caching is on or not.

Workflow without $form_state['cache']:
Get page -> Form construction #1
Post step1 ->
* Form is constructed (#2) and the form submitted.
* Form is rebuilt -> Construction (#3) + Form gets cached.
Post step2 ->
* Form is loaded from cache and the form submitted.
* Form is rebuilt -> Construction (#4)

Workflow with $form_state['cache'] (e.g. due to #ajax):
Get page -> Form construction #1 + Form gets cached.
Post step1 ->
* Form is loaded from cache and the form submitted.
* Form is rebuilt -> Construction (#2) + Form gets cached.
Post step2 ->
* Form is loaded from cache and the form submitted.
* Form is rebuilt -> Construction (#3)

Thus the we should have one construction less with caching. As said I think you are missing

<?php
 
array('query' => array('cache' => 1))
?>
for your initial GET request when trying to test with cache. Thus it's not enabled. I'd fix it myself however this testcase doesn't work on my local test environment - somehow the session is lost on every page load when running the test :(

#56

System Message - November 21, 2009 - 20:34
Status:needs work» needs review

rfay requested that failed test be re-tested.

#57

rfay - November 21, 2009 - 20:36
Status:needs review» needs work

The patch in #52 will have to be re-rolled due to #634440: Remove auto-rebuilding magic for $form_state['storage'] landing. I was about to do it, but since this is the most sensitive area of all our current undertakings, I thought I'd leave it to the principals on this issue.

#58

sun - November 26, 2009 - 20:47
Issue tags:+D7 Form API challenge

.

#59

fago - December 1, 2009 - 17:12

also we can't just remove the check for 'submitted' as else the form might rebuild even when it's loaded initially. I think checking "$form_state['process_input']" instead should do it as we only want to rebuild when the input has been processed beforehand.

#60

JoepH - December 2, 2009 - 22:22

The previous step button will not work any longer on multistep forms (D6.14).
Please rollback or point me to a an example how to build a multistep form with previous step buttons.

Cheers!

#61

rfay - December 2, 2009 - 22:36

@JoepH: This is a D7 issue, and nothing has been committed yet. I'm not familiar with a 6.14 regression on this, but you may find one. But this isn't the place for the discussion.

When you do pursue this, you'll have to give a very specific example of your problem or nobody will be able to help you out.

#62

Alan D. - December 3, 2009 - 00:36

@rfay Just a reminder, this is also a D6 issue to as of #30 when the changes were committed into the D6 branch.

This change is preventing a couple of our sites from being upgrading to 6.14, although the change itself is required by two of our other D6 sites.

#63

rfay - December 3, 2009 - 00:47

I apologize for the misdirection and error. I am so used to things going into 7 and then working their way into 6.

#64

aaron - December 3, 2009 - 20:58

#65

JoepH - December 8, 2009 - 00:41

Would it be a good idea to create a new issue for D6?
Please read #61.

Thanks

#66

grendzy - December 8, 2009 - 01:15

JoepH: The D6 fix will be in this issue, indicated by the issue tag drupal-6.15-blocker.

#67

dww - December 8, 2009 - 01:27

@rfay re: #61: Uhh, please read this issue, starting at comment #31. This is absolutely a D6 regression in 6.14, and we definitely need to fix it. In fact, the only reason this issue has version "7.x-dev" is the policy of fixing in HEAD first and then backporting.

#68

trupal218 - December 8, 2009 - 04:09

subscribing

#69

fago - December 8, 2009 - 12:23

So let's fix it in d7 now! I've setup a working dev-environment in a virtual machine, so I gave this a try.

@#42: The form shouldn't rebuild if there is a validation error, this was broken before this patch landed initially.

@proposed fix:
The fix was broken as 1) it triggered form rebuilds even when the form was shown the first time, 2) it tried to invoke a #submit handler for a button of type 'button', however this is the only distinction of 'button' buttons to 'submit' buttons - they don't submit the form. 1) was the cause for the wrong construction counts as I noted in #55.

So to fix I changed it to check for "$form_state['process_input']" instead 'submitted', that way the form doesn't build twice for the first page load, but also rebuilds for buttons of type button.

I also overhauled the test case to test this, however this wasn't so easy as in d7 it's not so easy to trigger form rebuilding for buttons of type button because
* just setting the storage doesn't trigger rebuilding any more
* enabling $form_state['rebuild'] during the constructor doesn't work right yet once caching is turned on, see #648170: Form constructors cannot enable form caching or form rebuilding
* submit callbacks aren't invoked for buttons of type button.
So I used a validation handler to set $form_state['rebuild']. For that I added a "Reset" button to the test, which just rebuilds the form with the previous values from storage.
However if rebuild isn't set the form would just re-load - so the same form would be presented again. This might be useful just to run the validation handlers. So I tested this case by implementing a simple "Reload" button.

Thus the test covers now
* rebuilding through a submit button
* rebuilding with a button button
* not rebuilding with a button button

AttachmentSizeStatusTest resultOperations
button_fix.patch11.24 KBIdlePassed on all environments.View details | Re-test

#70

fago - December 8, 2009 - 12:23
Status:needs work» needs review

#71

sun - December 8, 2009 - 15:14
Status:needs review» reviewed & tested by the community

+++ modules/simpletest/tests/form.test
@@ -589,13 +621,10 @@ class FormsFormStorageTestCase extends DrupalWebTestCase {
     // At this point, the form storage should contain updated values, but we do
     // not see them, because the form has not been rebuilt yet due to the
-    // validation error. Post again with an arbitrary 'title' (which is only
-    // updated in form storage in step 1) and verify that the rebuilt form
-    // contains the values of the updated form storage.
-    $edit = array('title' => 'foo', 'value' => '');
-    $this->drupalPost(NULL, $edit, 'Save');
-    $this->assertFieldByName('title', 'title_changed', t('The altered form storage value was updated in cache and taken over.'));
-    $this->assertText('Title: title_changed', t('The form storage has stored the values.'));
+    // validation error. Post again and verify that the rebuilt form contains
+    // the values of the updated form storage.
+    $this->drupalPost(NULL, array('title' => 'foo', 'value' => 'bar'), 'Save');
+    $this->assertText("The thing has been changed.", 'The altered form storage value was updated in cache and taken over.');

I really hope that this is 100% the same result, 'cause I need this to function properly in D7. It looks like it is, so I'm going to trust you. ;)

This review is powered by Dreditor.

#72

fago - December 8, 2009 - 15:23

Yep, it's the same.

I had to adapt it as I changed the test-form to not 'reload' the form once it's finished, because else we would get another "form construction message" which might generate a false positive for the other tests. Also the title output reflects now the actual form value and not the storage, anyway a dedicated output ("The thing has been changed.") is easier to grasp.

#73

Gábor Hojtsy - December 16, 2009 - 21:40
Issue tags:-drupal-6.15-blocker

Given this turned out to be more complex then to be possible for D6.15, it did not actually block that release. I'd very welcome a D6 fix for this soon, right after D7.

#74

Dries - December 17, 2009 - 17:18
Version:7.x-dev» 6.x-dev
Priority:critical» normal
Status:reviewed & tested by the community» fixed

Committed to CVS HEAD. Thanks! Changing version to D6.

#75

Gábor Hojtsy - December 17, 2009 - 17:34
Priority:normal» critical
Status:fixed» patch (to be ported)

It is actually a critical issue for Drupal 6 as well (requires followup to original patch), not at all fixed there as far as I understand.

#76

jbrown - December 18, 2009 - 15:30

Subscribing

#77

ssm2017 Binder - December 19, 2009 - 06:22

subscribing

#78

bjcool - December 22, 2009 - 09:19

When can we have a fix for 6.x? Since now months we have to life with a patched core...

#79

alex_b - December 22, 2009 - 22:05

Also OpenID Provider relied on the pre 6.14 behavior. What's interesting is that a coincidentally set $_POST global concealed the bug. When $_POST was accidentally set (from a different form submission), the new form was eventually rebuilt and $form_state - on which the OpenID Provider form in question relied - was cached.

Detailed writeup here: #621956-7: Redirecting fails when not logged in on the provider site

Haven't had the time to look at #69.

#80

fago - December 23, 2009 - 11:58
Status:patch (to be ported)» needs review

Here is a backport of the d7 fix (#69). As for d7, this re-enables form rebuilds for buttons of #type 'button'.

AttachmentSizeStatusTest resultOperations
forms_backport_D6.patch1.66 KBIgnoredNoneNone

#81

sun - December 25, 2009 - 00:27
Status:needs review» reviewed & tested by the community

Looks good - and looks like an API change at first sight, but we'd have to duplicate a very long + awkward condition otherwise.

#82

fago - December 30, 2009 - 10:47

Yep, it sets the 'process_input' flag known from d7, so we can avoid this long + awkward condition. However a new flag won't break anything, so it should be fine that way.

#83

JoepH - December 30, 2009 - 16:37

#80 still breaks a multi-step form that has been working fine on 6.14 6.13.
I will investigate further.

edit:
on 6.14 the previous step functionality is not working when required fields are not filled in.

for 6.13 we created an ugly workaround by clearing the messages in the session. From 6.14 this not enough anymore, we will also need to set the $form_state['submitted'] = true and clear the messages.
see http://drupal.org/node/472566

off topic: is there a clean way of implementing previous step functionality that bypasses the internal required fields validation?

#84

profix898 - December 30, 2009 - 16:53

subscribing

#85

fago - December 30, 2009 - 22:58

@#83: Well clearing the messages shouldn't be enough, when it was, then because you triggered the "form rebuilds even when there are validation errors" bug fixed by this issue.

#86

Summit - January 11, 2010 - 09:59

Subscribing,
greetings, Martijn

#87

sun - February 2, 2010 - 12:37
Version:6.x-dev» 6.15
Issue tags:+drupal-6.16-blocker

When comment previews are configured to be required, no one is currently able to submit a comment in D6. This patch also fixes that bug.

 
 

Drupal is a registered trademark of Dries Buytaert.