<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>HCoder.org &#187; problem</title>
	<atom:link href="http://hcoder.org/tag/problem/feed/" rel="self" type="application/rss+xml" />
	<link>http://hcoder.org</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Thu, 09 Feb 2012 22:15:38 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Problems with comments</title>
		<link>http://hcoder.org/2008/11/26/problems-with-comments/</link>
		<comments>http://hcoder.org/2008/11/26/problems-with-comments/#comments</comments>
		<pubDate>Wed, 26 Nov 2008 18:30:00 +0000</pubDate>
		<dc:creator>emanchado</dc:creator>
				<category><![CDATA[Meta]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[comments]]></category>
		<category><![CDATA[problem]]></category>
		<category><![CDATA[typo]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Today, my good friend &#8220;Esberrito&#8221; warned me that comments were not working in the blog. I hadn&#8217;t realised earlier, but I had them enabled so they should have appeared all the time. I investigated a bit, and it turns out that there&#8217;s some bug (apparently related to saving a post as draft, then publishing) that [...]]]></description>
			<content:encoded><![CDATA[<p>Today, my good friend &#8220;Esberrito&#8221; warned me that comments were not working in the blog. I hadn&#8217;t realised earlier, but I had them enabled so they should have appeared all the time.</p>
<p>I investigated a bit, and it turns out that there&#8217;s some bug (apparently related to saving a post as draft, then publishing) that makes the post have an empty &#8220;permalink&#8221;. When this happens, the link to the blog post looks exactly like the view of the posts for that particular day (say, http://hcoder.org/2008/11/23/ instead of http://hcoder.org/2008/11/23/why-i-hate-rubygems), so Typo decides that it shouldn&#8217;t show the comment form.</p>
<p>The bad news is that many posts are fucked now (although I have fixed some of the most recent ones). The good news is that it&#8217;s more or less easy to fix. You just have to connect to a &#8220;Rails terminal&#8221; with the production configuration (with <code>./script/console production</code>) and do something like this for each post you want to fix:</p>
<p>&gt;&gt; a = Article.find(:first, :conditions =&gt; [&#8220;title <span class="caps">LIKE</span> ?&#8221;, &#8220;<span class="caps">GPG</span>%&#8221;])<br />
=&gt; #&lt;Article id: 41, type: &#8220;Article&#8221;, yadda, yadda, yadda, &#8230;&gt;<br />
&gt;&gt; a.title<br />
=&gt; &#8220;<span class="caps">GPG</span> confusion&#8221;<br />
&gt;&gt; a.permalink = a.stripped_title<br />
=&gt; &#8220;gpg-confusion&#8221;<br />
&gt;&gt; a.save<br />
=&gt; true</p>
<p>Lesson learned: don&#8217;t save as draft for now (maybe I should upgrade to 5.1.3, it seems fixed there). Instead, untick the &#8220;Online&#8221; under &#8220;Post settings&#8221;, and hit &#8220;Publish&#8221;. That will assign a default, sane permalink value.</p>
 <p><a href="http://hcoder.org/?flattrss_redirect&amp;id=50&amp;md5=50c89ef561373561975e9be6466b3c4b" title="Flattr" target="_blank"><img src="http://hcoder.org/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://hcoder.org/2008/11/26/problems-with-comments/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<atom:link rel="payment" href="http://hcoder.org/?flattrss_redirect&amp;id=50&amp;md5=50c89ef561373561975e9be6466b3c4b" type="text/html" />
	</item>
	</channel>
</rss>

