Support forums : You can sense the bug

Gravatar plugin and RSS/Atom feed links

Not like "it smells funny when I click that". This is for bugs that don't show an error but something just doesn't seem right or ends up doing something you think is wrong. It doesn't show you an error but you know something ain't right.

Moderator: Dracones

Gravatar plugin and RSS/Atom feed links

Postby BushLeagueCritic » Sat Sep 18, 2010 6:17 pm

The comment feeds links don't display as expected with the Gravatar plugin enabled. The avatar images are included in the comment content, but the the 'comments.main.php" files of the xml templates don't have the image processing functions that the 'index.main.php' files do. So when you click the links, the page displayed (used to subscribe) only shows the the titles with no content. The feeds still function properly in the newsreaders that I've tried (the avatars and content are included), but the feeds won't validate with the W3C Validator.

How hard would it be to strip the avatar images out of the comment feeds with the existing template code? Or should I be looking at how the Gravatar plugin inserts its html?
BushLeagueCritic
User avatar
 
Posts: 47
Joined: Wed Jul 21, 2010 2:50 pm

Re: Gravatar plugin and RSS/Atom feed links

Postby EdB » Sat Sep 18, 2010 9:07 pm

I'd say we make the feed templates do it the right way, meaning if we have plugins that twiddle the comment content (and we do) then the feeds should show that.
EdB
Dracone
User avatar
 
Posts: 2072
Joined: Sun Nov 22, 2009 7:20 am
Location: Maricopa Arizona

Re: Gravatar plugin and RSS/Atom feed links

Postby BushLeagueCritic » Sun Sep 19, 2010 11:03 pm

OK. I got my head around this whole thing.

The xml feed templates use the get_content() function from the main 'Comment' class (qp_inc/comments/model/_comment.class.php), requesting the content be 'entity encoded'. That works fine, but the get_content() function also calls $Plugins->trigger_event( 'FilterCommentContent', array( blah,blah,blah ) ) without passing the requested encoding format to the plugins. So In this case, the Gravatar plugin ignorantly spits out its html that breaks the comments feed.

My solution is to pass the requested encoding format (which defaults to 'htmlbody' if not specified) to the plugins by adding a parameter to the $Plugins->trigger_event call in the get_content function of the comment class. Any plugins can then decide for their own big selves how to respond to the formatting request via $params['format'].

I'm pushing a branch that makes one small change to each of the _comment.class.php, and the _comments_gravatars.plugin.php files as a possible solution. The feeds display properly and validate fully with these changes. I haven't found anything else that it may break, but somebody else may.

https://code.launchpad.net/~quam-plures-core/quam-plures/xml-comment-feeds-fix
BushLeagueCritic
User avatar
 
Posts: 47
Joined: Wed Jul 21, 2010 2:50 pm


Return to You can sense the bug

Who is online

Users browsing this forum: No registered users and 1 guest

cron