It always bugged me and made it unclear that the form not found error would come before all the reasons why the form wasn't found. As logically all those reasons were found first in order to conclude that the form wasn't found.

The other problem this creates is that the error messages about what actually went wrong get mixed up with all the subsequent errors related to the form not submitting properly.

This patch changes the order so that all reasons why form wasn't found are output before the form was not found message.

This patch also clarifies on the drupalPost documentation how to submit values for multiple selects, something which I have had a number of people ask me.

The way to submit muti-steps forms is also not clear, so I have documented that as well in response to recent issue. #292375: Multistep forms drupalPost doesn't work

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

boombatower’s picture

boombatower’s picture

You can test this with the following patch.

dmitrig01’s picture

Title: SimpleTest: Clafify form documentation and error handling » SimpleTest: Clarify form documentation and error handling
dmitrig01’s picture

+   *   $edit = array();
+   *   $edit['name[]'] = 'value1';
+   *   $edit['name[]'] = 'value2';

That's wrong - name[] is going to be value2. Youd have to do:

+   *   $edit = array();
+   *   $edit['name'][] = 'value1';
+   *   $edit['name'][] = 'value2';

which I don't think is supported

boombatower’s picture

hmm not sure how I managed that.

boombatower’s picture

From looking at the code this would appear to be correct, but I will test shortly. This is the main reason I want these areas documented, as they are not clear and the code is rather hard to decipher.

$edit = array();
$edit['name[]'] = array('value1', 'value2');
boombatower’s picture

Status: Needs review » Reviewed & tested by the community
FileSize
2.21 KB
Dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to CVS HEAD. Thanks.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.