OK, I'm new to Rails and sqlite and MySQL, so this took me half an
hour but...
The development log showed this SQL:
SELECT * FROM pages WHERE (pages.parent_id = 4 AND ((((virtual = 'f')
and (status_id = 100)) AND (STRFTIME('%m', published_at) = 6)) AND
(STRFTIME('%Y', published_at) = 2006))) ORDER BY published_at DESC,
virtual DESC, title ASC
Which I traced to the archive_finder.rb in models. This line:
add_condition(options, "#{extract('month', 'published_at')} = ?",
month.to_i)
then these:
when /sqlite/i
case part
when /year/i
"STRFTIME('%Y', #{field})"
when /month/i
"STRFTIME('%m', #{field})"
when /day/i
"STRFTIME('%d', #{field})"
end
BUT, STRFTIME('%m' returns a character value, such as '06', whereas
it's being compared to the integer 6. I tested in sqlite3 and no rows
returned. Wow, 17 years of Oracle experience counts for something in
this Web world.
So, strftime needs to be wrapped with a string-to-integer conversion,
yes?
andrew
On 11/08/2006, at 8:55 AM, Nathan Wright wrote:
> You didn't happen to freeze the rails gem to your vendor directory at
> any point, did you?
>
> On 8/10/06, Andrew Barnett <[EMAIL PROTECTED]> wrote:
>> On 11/08/2006, at 7:50 AM, Nathan Wright wrote:
>>
>>> Just to make sure that I wasn't losing it, I installed Rails 1.1.6,
>>> reinstalled Radiant 0.5.1 using the gem, created a new radiant site
>>> using option 3, and fired it up ... it works for me.
>>>
>>
>> I've just done the same and it doesn't work :-(. I verified that the
>> page is exactly as per the demo. I get monthly archive links in the
>> sidebar for August and June, click on them, get an August 2006 page
>> with no articles.
>>
>> Gotta be my setup.
>>
>> Oh well.
>>
>> BTW, I'm also having to run under Rails 1.1.5. When I edit
>> environment.rb to be 1.1.6, I get an error
>>
>> can't activate rails (= 1.1.6), already activated
>> rails-1.1.5]
>> (Gem::Exception)
>>
>>
>> andrew
>> _______________________________________________
>> Radiant mailing list
>> [email protected]
>> http://lists.radiantcms.org/mailman/listinfo/radiant
>>
>
>
> --
> Nathan
> _______________________________________________
> Radiant mailing list
> [email protected]
> http://lists.radiantcms.org/mailman/listinfo/radiant
_______________________________________________
Radiant mailing list
[email protected]
http://lists.radiantcms.org/mailman/listinfo/radiant