Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
If you enable the blog module you will get links to Username's blog below EVERY node.
That's because there are some brackets missing in the hook_view.
Drupal 7
if ($node->type == 'blog' && arg(0) != 'blog' || arg(1) != $node->uid) {
// add links
}
There should be a bracket around the last two parts, as it is currently in the Drupal 6 implementation:
Drupal 6
if ($type == 'node' && $node->type == 'blog') {
if (arg(0) != 'blog' || arg(1) != $node->uid) {
//add links
}
}
The patch adds these brackets.
Screenshot before: we see links on every content type (Article and Blog)
Screenshot after: only links on the Blog content type
Comment | File | Size | Author |
---|---|---|---|
after.png | 31.38 KB | BarisW | |
before.png | 33.6 KB | BarisW | |
blog_links.patch | 810 bytes | BarisW | |
Comments
Comment #1
BarisW CreditAttribution: BarisW commentedForgot the status...
Comment #2
Bojhan CreditAttribution: Bojhan commentedThis is not critical, however seems like an obvious fix. Will ask someone to review.
Comment #3
dawehnerCode looks fine.
I was able to manual reproduce the problem. The patch fixes this problem
Comment #4
Dries CreditAttribution: Dries commentedCommitted to CVS HEAD. Thanks.