I tested this field adn set as required but when I select 'Other' and DO NOT type anything the node is saved without informing that field is required.
Is that a bug or you want to make it working like that ?
Thanks for quick module, its good that is saves the other value in the same field.
Do you still mantain that ?
| Comment | File | Size | Author |
|---|---|---|---|
| #13 | 898062-d7.patch | 2.37 KB | mradcliffe |
| #5 | 898062-2.patch | 2.75 KB | mradcliffe |
| #4 | 898062.patch | 1.06 KB | mradcliffe |
Comments
Comment #1
mradcliffeI'll take a look into this as soon as I can.
Comment #2
benone commentedWow :) if you take a look as fast as you answered it will be a drupal issue record in patching time ;)
Comment #3
benone commentedI tested again when I do not type anything it just fill this field with word 'other'. I can see that when I go to edit.
Comment #4
mradcliffeThis patch passes all tests currently. I may write a test specifically for this case.
Comment #5
mradcliffeOkay, here's a patch with an added test to test default values. Passes.
I ran the test with the .module file unpatched, and it failed. So that's good too.
Comment #6
benone commentedThats great.
In meanwhile I found also this module and gave it a try - http://drupal.org/project/select_or_other .
It works in exactly the same way. Can you explain me the difference between them ?
I checked using devel if the other field value is stored in the same field and it is.
So I actually dont see any difference. Is there any ?
Comment #7
mradcliffeThere really isn't much difference. I didn't find the module until after I had developed this one and posted it, but need to keep this one updated.
Comment #8
benone commentedorayt, understand.
Comment #9
mradcliffeComment #10
mradcliffeoops
Comment #11
mradcliffeThe patch is working in Drupal 6. There is the same problem in Drupal 7, but it needs additional finagling to get it to work. It seems that default values are not same the same way as they are in CCK in Drupal 6 (ugh, D7 field api).
Comment #12
mradcliffesetting status.
Comment #13
mradcliffeFor D7 (and maybe changing for D6): A better way to do this is with required option on fields and do an option element_validate callback if required is set.
Hindsight is 20/20
Comment #14
mradcliffeCommitted.