Cleaned up commentrss_format_items() introduced formatting bug

toemaz - September 18, 2009 - 17:55
Project:Comment RSS
Version:6.x-2.x-dev
Component:Code
Category:bug report
Priority:critical
Assigned:Unassigned
Status:closed
Description

Commit 263684 introduced a bug with the formatting of pubDate, dc:creator and guid.

Current wrong output:

<pubDate> <key>pubDate</key>  <value>Fri, 18 Sep 2009 09:19:52 -0400</value> </pubDate>
<dc:creator> <key>dc:creator</key> <value>xxx</value> </dc:creator>
<guid> <key>guid</key> <attributes> <isPermaLink>false</isPermaLink> </attributes> <value>xxx</value> </guid>

Old good output:

<pubDate>Fri, 18 Sep 2009 13:19:52 +0000</pubDate>
<dc:creator>xxx</dc:creator>
<guid isPermaLink="false">xxx</guid>

Direct diff link:
http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/commentrss/...

#1

toemaz - September 18, 2009 - 18:01
Status:active» needs work

Quickest solution: change line 210 in commentrss.pages.inc

from

<?php
$items
.= format_rss_item($comment->subject, $link, $content, $extra);
?>

to
<?php
$items
.= format_rss_item($comment->subject, $link, $content, array_values($extra));
?>

Tested on production website and it works.

#2

Dave Reid - September 18, 2009 - 18:34
Status:needs work» fixed

Fixed the $extra array itself. Committed to CVS in http://drupal.org/cvs?commit=264592. Thanks!

#3

frjo - September 20, 2009 - 12:49
Status:fixed» needs review

The committed fix is not working as far as I can see. The isPermaLink atribute is e.g. never set on"guid".

My patch reverts the code to pre 6.x-2.2 and it's also the same way node module in core build the $extra values.

AttachmentSize
comentrss_commentrss_format_items.patch 2.2 KB

#4

Dave Reid - September 20, 2009 - 15:24
Status:needs review» fixed

It was working better, but thanks for following up that it wasn't working completely. It seems the array passed into format_rss_item can't use string keys, so I just changed it back using the relevant parts of the rollback patch in #3. I double-confirmed that it's working properly now. Sorry about that. Going to make a new release soon once a few more module code re-organizations happen.

#5

System Message - October 4, 2009 - 15:30
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.