The comment form builder adds an #after_build function when $op == t('Preview'). This is already obsolete, but when adding an AHAH element, #cache is set to TRUE and the form_builder is not invoked on submission. This breaks previews when AHAH elements are added.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | comment_preview_fapi3.patch | 5.96 KB | chx |
Comments
Comment #1
heine commentedHere's a steps to reproduce; enable the test module below, visit the comment form, fill the comment body and click preview. There will be no preview.
If you comment out "'path' => 'test/js',", visit the comment form again (don't reload!), fill the comment body and click preview, you'll notice a preview will be shown.
In form.inc: 1760 the AHAH process handler sets
$element['#cache'] = TRUE;Then form_builder sets this for the entire form:
Test module, the preview behaviour is what interest me.
Comment #3
chx commentedI am afraid this is too big for D6 but here is an attempt to fix this.
Comment #4
birdmanx35 commentedBingo: Still works against HEAD.
Comment #5
mfbSubscribing.
Comment #6
sunThis has been fixed for D7 already, but cannot be backported.