Fasttoggle is a powerful tool for toggling not only built-in object properties (e.g., user status) but also custom properties. However, due to limitations in comment module, at present we can't add toggleable properties to comments like we can to nodes and users.
Specifically, I'm trying to add a custom toggleable property, http://drupal.org/node/226836, so that users can block content by the author of a comment. But I have no way to add a property to a comment. While nodes and users support API 'load' ops and therefore custom properties, comments by default do not. In e.g., in fasttoggle_link() we test for a changed property, but if we can't set the property in the first place we can't test if it's changed. We're limited to the fields in the comments table (_comment_load() is a single-table SQL select query.)
The attached patch (on HEAD, but should apply to 6.x and 5.x) adds support for a hook_comment() 'load' op, which would enable custom toggleable properties for comments.
(This is a bit like we've already done with user links. The user module doesn't call hook_link() by default, so we've added an implementation.)
| Comment | File | Size | Author |
|---|---|---|---|
| fasttoggle-comment-load.patch | 2.06 KB | nedjo |
Comments
Comment #1
yngens commentedTried to apply against 5.x.-1.x.dev and it gave an error:
Comment #2
yngens commentedapplying to 5.x.-1.0 has given:
Comment #3
nedjoThe patch is against HEAD. It would need adapting for 5.x.
Comment #4
kkaefer commentedThanks, looks good. I committed it to HEAD. Let me know whether it solves your problem. If it does, I'll release a new version.
Comment #5
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #6
melkinny360 commentedHi,
By Peter deHaan On September 27, 2010 · Leave a Comment ... Creating a custom label function on a Spark ButtonBar control in Flex 4 ... button labels on an MX ButtonBar control in Flex by setting the labelFunction property.
...............
Sunshine Coast real estate