switch to drupal_execute, and some new features
gcassie - May 26, 2009 - 01:43
| Project: | Comment CCK |
| Version: | 5.x-1.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs work |
Description
I've been working with this module over the weekend, and thought I would share my results. There are a few things going on in this patch, which I know isn't the best form, but I wanted to get the ideas out there.
- The biggest thing this patch tries to do is move comment_cck away from node_save and towards drupal_execute in hook_comment. I think this is going to be the key to working with various sorts of nonstandard/complex cck fields, since you're simulating a form submit.
I haven't quite gotten it working yet though, so a caveat to this patch: cck fields that aren't editable from the comment will get wiped. It does, however, work for userreference and nodereference fields, both autocomplete and select list.
I'm hoping someone else can play around with these changes and move them forward.
- Added some options to the content type screen, which allow you to:
- Use the content type's teaser display settings for the summary table at the top of the comments. These are often shorter than a full node view.
- Toggle a header on the summary table.
- Unmandate and shorten the body field of comments.
- Using node_build_content instead of _comment_cck_render_field when rendering the summary table.
- Trying to work with ['#access'] = FALSE while excluding uneditable fields, instead of building up a new form.
I hope some of these other features are useful, but I really hope someone can give some insight on how to make drupal_execute hum here.
| Attachment | Size |
|---|---|
| comment_cck_drupal_execute_plus.patch | 14.46 KB |
