At line 50

    if (arg(0) == 'node' && is_numeric(arg(1)) && variable_get('commentrss_node', TRUE)) {

should read

    if (arg(0) == 'node' && is_numeric(arg(1))) {
      if (variable_get('commentrss_node', TRUE)) {

otherwise, if 'commentrss_node' == FALSE the logic incorrectly falls through to line 57

    elseif (arg(0) == 'node' && variable_get('commentrss_site', TRUE)) {

and the feed 'crss' gets incorrectly appended to an individual node

Comments

junyor’s picture

Status: Active » Needs review
StatusFileSize
new2.6 KB

The code may be wrong, but it's fine to have multiple feeds announced per page. The attached implements a fix:

* Fixes the logic for adding feeds, allowing both the all comments and node-specific feeds on the same page
* Fixes a bug where the wrong variable was checked for showing the vocabulary_list feed
* Adds the site name to all generated feed titles

junyor’s picture

This updated patch outputs absolute URLs for the feeds, to be consistent with Core.

junyor’s picture

And another with slightly better naming for the taxonomy feed.

junyor’s picture

One more. It looks like I had forgotten to update the title and description output with the feed. Before, just the LINK element was updated.

gábor hojtsy’s picture

Status: Needs review » Needs work

Patch has very straneg/bad artifacts like:

- Comments from the “@vocab” Vocabulary
- Comments from the “@term” Category

etc. These bad UTF chars are not nice, and I don't understand the capitalization mis-sentence. Also, why mix unrelated changes, when we are fixing an issue with mis-linking to RSS feeds?

gábor hojtsy’s picture

Version: 5.x-1.x-dev » 5.x-2.x-dev
Assigned: Unassigned » gábor hojtsy
Status: Needs work » Fixed

I just committed a 5.x-2.x dev version of the module, which has this bug fixed as well. The site RSS feed has multiple options on where it should be added, and that's strictly adhered to. Please test that and reopen if you still have issues.

http://drupal.org/cvs?commit=113501

junyor’s picture

Yeah, I guess I should have taken the naming stuff to a different issue. Sorry about that.

I apologize if this is a stupid question, but isn't there a logic problem in the switch statement in commentrss_menu? The COMMENTRSS_SITE_FRONT_AND_NODE_PAGE case won't work if the /node page isn't the front page, but that's not how the setting is described.

gábor hojtsy’s picture

Status: Fixed » Needs work

Good catch! You mean to replace:

      case COMMENTRSS_SITE_FRONT_AND_NODE_PAGE:
        if (!drupal_is_front_page() && ($_GET['q'] != 'node')) {
          // Only break if not front page and not node page.
          break;
        }

with:

      case COMMENTRSS_SITE_FRONT_AND_NODE_PAGE:
        if (!drupal_is_front_page() || ($_GET['q'] != 'node')) {
          // Only break if not front page and not node page.
          break;
        }

(note the && replaced with ||), so that it really only breaks if it is not the front page or not the node page?

junyor’s picture

Exactly.

gábor hojtsy’s picture

Status: Needs work » Fixed

Committed, thanks!

Anonymous’s picture

Status: Fixed » Closed (fixed)

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