minad / olelo

Wiki with git backend
MIT License
241 stars 43 forks source link

500 errors when navigating tree with multiple levels, blog-style #44

Closed candlerb closed 13 years ago

candlerb commented 13 years ago

How to reproduce (starting with olelo rev ca375f49)

Same occurs if you try to use the tree view in the sidebar. Clicking on the folder '2010' does nothing, and the unicorn log shows a 500 error.

Note that http://localhost:8080/Blog/2010/12 has the same problem, but http://localhost:8080/Blog/2010/12/23 shows its child correctly.

Platform: ubuntu 10.10, stock ruby 1.8.7p299

Side issue: I also can't get the blog renderer to work. I can't render /Blog/2010/12 (see above), but if I try to create it, it says "Path is reserved"

minad commented 13 years ago

The blog feature works a bit different currently. Create a folder /blog with the articles in it. /blog/year and /blog/month are automatically mapped to a filtered view of /blog. The log file is in .wiki/log. Does this help you?

candlerb commented 13 years ago

Many thanks for your very rapid response!

I started again (rm -rf .wiki) Created page /blog/foobar with one-line content, set type text/x-markdown

I can browse to /blog and /blog/foobar, but /blog/2010 gives a 500 error. Looking in .wiki/log, the error is:

E, [2010-12-23T11:40:25.553105 \#16539] ERROR -- : undefined method `GET /' for #<Olelo::Application:0x7fe9e7aa7890> (NoMethodError)
/v/git/olelo/plugins/blog/blog.rb:7:in `send'
/v/git/olelo/plugins/blog/blog.rb:7:in `GET (/:path)/:year(/:month)'
/v/git/olelo/lib/olelo/routing.rb:124:in `send'
/v/git/olelo/lib/olelo/routing.rb:124:in `route!'
/v/git/olelo/lib/olelo/hooks.rb:51:in `with_hooks'
...

I get the same error trying to access /blog/2010/12

If I try to access /blog/2010/12/23 then I get redirected to /new/blog/2010/12/23 (i.e. it wants me to create a page under that URL)

Final point: I didn't set the posting date anywhere on the 'foobar' page. Is there some metadata to set, or is it implied from when the page was committed?

minad commented 13 years ago

There was a change which broke the blog plugin. Sorry for that. Fixed in 540be330419b321cd6d28cb53a7c039f11698692

Please let me know if it works

candlerb commented 13 years ago

Getting better, and no 500 errors, but I don't think it's there yet.

I create two entries, /blog/wibble and blog/bibble

If I go to /blog/2010 or /blog/2010/12 then the page looks like this:

Root
blog
a minute ago written by localhost.localdomain          Full Article

And "Full Article" just links to /blog

So this "listing" appears to list only the blog itself, rather than the individual articles.

minad commented 13 years ago

pushed some other fixes. Works here:

http://git.awiki.org/Tests/2010/09

candlerb commented 13 years ago

Yay, thank you :-)

I notice there is code for a blog menu, but I can't see how to make use of it.

Also, it would be nice to have some indication when an article has been truncated (e.g. indicate "more...") but I can probably hack that myself.

minad commented 13 years ago

The Full Article links are only shown if the article is truncated.

candlerb commented 13 years ago

The Full Article links are only shown if the article is truncated.

That's not how it works for me when I test it. For example, a one line article renders as:

wibble
23 hours ago  written by localhost.localdomain (127.0.0.1)
Hello world!                                      Full Article

And if I look in the blog.rb, @articles builds an array of [page, content] and there's no indication whether a particular content item has been truncated or not.

minad commented 13 years ago

Ah ok. Please contribute a patch if you want to have some improvements. Thx for the report.