As reported in #449614: "read more" gone (node.module is still using hook_link for that), hook_link() now only applies to comments. Some choices:

- Rename to hook_comment_link() (imbalance with node api)
- Make comments renderable, and use the same method as you use to add links to nodes (probable performance issues on pages with 100+ comments)
- Your Great Idea Here!

Let's discuss.

Comments

webchick’s picture

Issue tags: +DrupalWTF

Forgot my tag. ;)

dman’s picture

Yay, the unthemable node link pile is almost gone!
This is good.

sun’s picture

Priority: Normal » Critical

Upping prio, copying from #449614: "read more" gone (node.module is still using hook_link for that):

1) Is hook_links a relict of the past?

2) That condition test and $href munging sucks. We want separate links for each build mode.

3) Ideally, the admin is able to configure (i.e. enable/disable/add custom) links per build mode.

4) On a related note, $object->readmore should now not only dependent on build mode, but also, whether there is actually more to display.

catch’s picture

This is a pretty fundamental issue about how comment module should look for Drupal 7 really, sorry for taking it slightly out of scope.

Neither proper comment link handling nor fieldable comments can be done without rendering them properly - and webchick's right that this will slow down 100+ comments pretty significantly.

In fact, drupal_render() and theme() calls are about the only thing keeping nodes slower than comments at the moment, and nodes are better optimised in other places, so just rendering comments properly by itself might make them slower than nodes. This would be amusing, but not a good thing.

The three choices as I see it are these:

1. Status quo: Special case everything because comment is crappy already, and it might as well be crappy and somewhat performant. We should try to keep it at least working and documented in HEAD - so I'd be in favour of a patch for hook_comment_links() and hook_comment_link_alter() (with #112514: hook_link_alter doesn't work for comment links rolled in).

2. Remove the special casing and don't replace it - kill hook_link() altogether, consider removing hook_comment() - when you want fast comments, you get fast comments with no extras, otherwise use nodes instead.

3. Remove the special casing and replace it with proper rendering, fieldable and the rest. This brings comments into line with nodes, users etc.. We'd probably need a proof of concept patch before we can work out how much of a performance hit this would actually be.

There might be some options in-between these. For this specific issue I vote for #1.

I'd love to benchmark a Drupal 7 version of nodecomment vs. #3 though.

catch’s picture

Status: Active » Closed (duplicate)
catch’s picture

joshmiller’s picture

Issue tags: -DrupalWTF

Cleaning up DrupalWTF list... Since this is a duplicate, removing tag...