Saturday, April 5, 2008

typo bug fixing

Found 2 bugs in the blogging software typo that I am using. Both are related to the Atom feed for comments.

First, the theme incorrectly used the name instead of the id to retrieve the article. In views/articles/_article.html.erb, change :

<a href="<%= url_for :controller => 'xml',
 :action=>'feed', :type=>'article',
 :format => 'atom', :id => @article %>">Atom feed</a>.

to:
<a href="<%= url_for :controller => 'xml',
 :action=>'feed', :type=>'article',
 :format => 'atom', :id => @article.id %>">Atom feed</a>.


And in the app itself, the code forgot to check if there is any comment at all before trying to read from it. In app/views/articles/_atom_feed.atom.builder, change:

feed.updated atom_feed.first.updated_at

to:
unless atom_feed.first.blank?
    feed.updated atom_feed.first.updated_at
end

2 comments:

dc said...

will u fix the ssl cert and host name? i need to press ok everytime... -.-

kc said...

well... the CN for the cert is fixed. it is a easy fix anyway. but for CA, unless i pay for the signing or u decided to install and trust(!) my CA cert, there is nothing i can do... :P