Download & Extend

Option to disable feeds in header and implement block with links to comment rss feeds

Project:Comment RSS
Version:6.x-2.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

hey there.

so the links for comment rss feeds are listed first in the $head of the pages they are inserted into

for most bots, the first link is assumed to be the content feed for that page, so when users add a site to an rss service (e.g., AideRSS) the comments feed becomes the main, indexed feed for that site.

comment rss feeds should be listed after the drupal content rss link

Comments

#1

I got hit by this in with Technorati picking up my comments instead of my posts on my site. I'll see if I can poke around over the weekend and create a quick patch.

#2

I figured that this would be pretty complex to fix. It's my first time really looking at Drupal's code, so I'm pretty much learning how it works at the same time.

For now, this is what I've discovered while stepping through the code:

It looks like the function to call to setup rss feeds is drupal_add_feed() in includes/common.inc. This function itself calls drupal_add_link(), which then finally calls drupal_set_html_head() (both in the same file) to insert the rss links into the a static variable that will eventually used as the header.

The main front-page RSS feed is inserted into the header in the function node_page_default() in the file modules/node/node.module.

The commentrss feeds are inserted into the header in the function commentrss_menu() in commentrss.module.

The unfortunate thing is that commentrss_menu() is called before node_page_default(), causing the comment rss feeds to be inserted before the main feed, causing the comments to be autodetected first.

There's no way that I can see where modifying the theme will be able to fix this.

I currently see two possible plans of action:

  1. Modify the drupal_add_feed(), drupal_add_link(), and drupal_set_html_head() to allow for "weighting" of header code, so commentrss_menu() can force the comment rss feeds to output after the main feeds. This will require modifications of the core drupal code, which would probably be more difficult to get accomplished (though this may be useful for other modules, too),
  2. Somehow cause commentrss_menu() to be called after node_page_default(). I am investigating this option, but I have little idea of where to go with this.

Hopefully, I will be able to develop a solution as I study the code, but feel free to add suggestions if you think of any.

#3

I had just thought of a third probably even better solution than the other two: Give an option to disable the comment rss links in the header, but provide a block with the links. I'll try to get to making a patch for this over the weekend, as I get some time.

#4

Title:comment rss feeds are first in auto-discovery before content rss, becomes default» Option to disable feeds in header and implement block with links to comment rss feeds
Status:active» needs review

The patch adds a new option under admin/content/commentrss which lets the admin choose whether to have the links to the feeds be added to the header or not. It also implements a block that will contain the links to the RSS feeds.

Turning off the add feeds to header option and placing the available block some where will get around the issue of the comment feeds coming before the front page RSS feeds, while still providing the comment rss feeds in the block.

AttachmentSize
commentrss-block.patch 4.09 KB

#5

Could this be fixed with the module weight module, setting Comment RSS to have a lower weight than Node?

If that doesn't work, I'd say this is a good thing to submit as a feature fix to core. It potentially affects every module that tries to add a feed.

#6

FYI, no, a weight change (higher or lower than node) to Comment RSS does NOT fix this.

#7

Version:5.x-1.x-dev» 6.x-2.x-dev
Status:needs review» needs work

Marked #356031: crss feed included too early in <head> as a duplicate of this issue. Needs to have some more work done for 6.x-2.x first.

#8

Category:bug report» feature request

#9

Status:needs work» fixed

The primary problem has now been addressed with #594484: Calling drupal_add_feed in hook_init breaks theming and assures that the rss.xml feed is always listed first on the homepage. I don't think we need to implement a new block here anymore.

#10

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

nobody click here