This is more of a follow up to #339929: Move node links into $node->content
It moves node "read more" link to $node->content instead of now comments-only hook_link. For reference, this is explained in the upgrade docs.
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | 449614-node_read_more.patch | 7.47 KB | AmrMostafa |
| #8 | 449614-node_read_more.patch | 7.48 KB | AmrMostafa |
| #7 | 449614-node_read_more.patch | 6.19 KB | AmrMostafa |
| #2 | node-read_more.patch | 1.7 KB | AmrMostafa |
| #1 | node-read_more.patch | 1.71 KB | AmrMostafa |
Comments
Comment #1
AmrMostafa commentedThis makes it
node->build_moreaware, this will make node_feed() simpler.Comment #2
AmrMostafa commented... and this is the correct patch :)
Comment #3
moshe weitzman commentedLooks like the right fix to me. thanks.
Comment #4
dries commentedIf hook_link is comments only now, so we consider renaming it for clarity? That could be done in another patch, but I wanted to bring it up now so we can create an issue for it if necessary.
Comment #5
webchickHm. Grepping for module_invoke_all('link'" reveals that this is present in poll.module as well. You can't have teasers in polls though, which is probably why this link isn't showing up there now. And I agree with Dries that if hook_link is indeed intended to be only for comments (and this is not the sign of a larger bug), then it probably makes sense to rename hook_links() to something more descriptive (or ditch it altogether), so I created #451272: Rename or remove or do *something* with hook_link() to deal with all of that.
As for this patch...
This:
is way less legible than the code before it. I had to read that about 3 times to get what it was saying. This at the very least needs a comment; possibly encapsulating into a function if it's something we're going to end up checking more than once ever.
Also, if "read more" has been broken for 3+ months, then GUESS WHAT that means we need? ;) Let's add a few tests to ensure that the read more link shows up, that when clicked the body is found, etc. I'm kind of surprised there isn't a test for this yet. Hm. Also, while we're at it, let's add a test for the RSS special-casing introduced in this patch, too.
Comment #6
sunHm. This patch makes me start to question much.
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.
Comment #7
AmrMostafa commentedHere is a new patch, it should address your comments so far, with tests :)
@webchick: for Poll, I've created/updated separate issues:
Comment #8
AmrMostafa commentedBetter patch, more cleanup and tests for RSS.
Comment #9
AmrMostafa commentedComment typo.
Comment #10
dries commentedI'm delegating this patch to sun (or webchick, obviously). sun can let me know when this is ready to go in. (@sun, if you don't want to be this patch's champion, just let us know.)
Comment #11
stella commentedThere are some minor issues to be fixed:
Also shouldn't we be using
drupal_strlen()rather thanstrlen()so we can correctly count the number of characters of UTF-8 strings?Cheers,
Stella
Comment #12
Tor Arne Thune commentedThis is no longer a valid issue as far as I can see, as hook_link no longer exists, for example, and I can find little code in the patch that corresponds to the current state of core. Confirmation, please?
Comment #13
jody lynnConfirmed, no longer an issue.