I'm surprised this issue hasn't been raised before because it seems so critical -- but maybe it's because I'm doing something wrong?
Symptom:
Comments submitted from the comment_form block on node pages get posted to wrong node. Replies to other comments are fine.
Problem:
The block is being cached per role, so the form's action url points to the wrong node.
Quick fix:
Update database to NOT cache the comment_form block. Clear cache.
mysql> update blocks set cache = -1 where module = 'commentblock' and delta = 'comment_form';
Real fix:
Blocks default to BLOCK_CACHE_PER_ROLE if not specified in hook_block op=list.
Attached is a patch to set the comment_form block's "cache" setting to BLOCK_NO_CACHE. (It'd be better if we could cache the block per-role and per-page, but that option doesn't seem to exist.)
http://api.drupal.org/api/function/hook_block/6
Also attached is a commentblock.install file with the update function to run the sql update.
HTH.
Greg
| Comment | File | Size | Author |
|---|---|---|---|
| commentblock.install.txt | 207 bytes | Greg Go | |
| commentblock-no-cache-form.patch | 933 bytes | Greg Go |
Comments
Comment #1
dixon_Thanks for noting! I'll submit that patch later tonight and roll a new release!