Closed (fixed)
Project:
SimpleTest
Version:
6.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
11 Jun 2009 at 15:48 UTC
Updated:
10 Feb 2010 at 02:00 UTC
Jump to comment: Most recent file
Hi,
In my web page I have an input like this :
<input id="edit-before" type="hidden" value="" name="before"/>
But I can't post any data to this form :
$edit = array('before' => 1);
$this->drupalPost('user/edit', $edit, t('Validate'));
It answers me :
Failed to set field before to 1
It works with text input.
Am I doing something wrong ?
Thanks.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | drupal_web_test_case.inc_.patch | 431 bytes | styhe_ |
Comments
Comment #1
dave reidSimpleTest currently only allows you to submit 'visible' fields. If you want a hidden field on your form, you should be using the FormAPI #type='hidden'. We are working on the potential to submit 'extra' POST data. See #335035: drupalPost() incorrectly submits input for disabled elements.
Comment #2
styhe_ commentedI simply add
case 'hidden':in the switch of the function 'handleForm' in 'drupal_web_test_case.inc' and it works.Comment #3
chriscohen commentedBump. It's pretty ridiculous that as it currently stands, I cannot post hidden fields. My module code uses hidden fields to store a 'calculated' value from some jQuery-powered form elements, and unless simpletest allows me to post hidden fields, it is not useful at all.
I can confirm this patch works, even with 6.x-2.9, although drupal_web_test_case.inc appears to be called drupal_web_test_case.php now.
Comment #4
damien tournoud commentedThis needs to be considered in core first.
Comment #5
proppy commentedHi,
I found the same issue in D6:
http://drupal.org/node/643918
Would you consider backporting styhe_'s patch ?
FYI, it applies well on simpletest-6.x-2.9:
Comment #6
j_ten_man commentedSubscribe
Comment #7
c960657 commentedThis was fixed in core with the patch for #595876: Taxonomy term reordering fails.
Comment #8
Stalski commentedsubscribing for drupal 6 and indeed patch works.
Comment #9
boombatower commentedCommitted.