climu / openstudyroom

Website for the Open Study Room online go/baduk/weiqi community.
https://openstudyroom.org
GNU General Public License v3.0
67 stars 33 forks source link

page 3 of blog produces error #372

Closed alexmitrani closed 5 years ago

alexmitrani commented 5 years ago

https://openstudyroom.org/blog/?page=3

"Internal server error Sorry, there seems to be an error. Please try again soon."

pages 1, 2 and 4+ seem to show ok.

thanks

climu commented 5 years ago

Wow, good catch!

NoReverseMatch

Reverse for 'entry_page_serve_slug' with keyword arguments
 '{'month': '12',
 'blog_path': 'blog',
 'day': '25',
 'year': '2018',
 'slug': 'new-teacher-jean-françois-gagnier-aka-bonesaw-added-register-for-a-free-lesson'}' 
not found.
1 pattern(s) tried: ['(?P<blog_path>.+)\\/(?P<year>[0-9]+)\\/(?P<month>[0-9]+)\\/(?P<day>[0-9]+)\\/(?P<slug>[-a-zA-Z0-9_]+)\\/$']
climu commented 5 years ago

For the record, the page is live here: https://openstudyroom.org/blog/new-teacher-jean-fran%C3%A7ois-gagnier-aka-bonesaw-added-register-for-a-free-lesson/

But this url won't indeed pass the pattern suggested above.

Other blog post are served at url like that: https://openstudyroom.org/blog/2019/04/02/march-update/

I am confuse on why this very post would have a different url

climu commented 5 years ago

Wait, some other blog post does the /blog/slug/ url: https://openstudyroom.org/blog/osr-bot-discord-now-official/

What on earth?

Edit: it is also served at https://openstudyroom.org/blog/2018/08/12/osr-bot-discord-now-official/

climu commented 5 years ago

It seems puput url configuration have been updated: On can read here:

In the same folder, add to urls.py near the top from puput import urls as puput_urls and just above url(r'', include(wagtail_urls)), add url(r'',include(puput_urls)),

And we were using url(r'', include('puput.urls')),. So I updated it according to the doc in this commit without any success.

The issue doesn't seem to be related to the status of entry or streamfieldentry:

The reverse seems to be called from the puput template tag in this template: https://github.com/climu/openstudyroom/blob/5e7c33627f72e9206f36f054cb33f88172f10ede/openstudyroom/templates/puput/blog_page.html#L35

Which seems to fit puput default template: https://github.com/APSL/puput/blob/c3294f6bb0dd784f881ce9e3089cbf40d0528e47/puput/templates/puput/blog_page.html#L53

We are calling the get_url() method with success on this entry when looking for "bones" https://github.com/climu/openstudyroom/blob/5e7c33627f72e9206f36f054cb33f88172f10ede/fancysearch/views.py#L82

climu commented 5 years ago

Here I find some explanations:

As Puput is made as a Wagtail plugin so you can acces to a entry page with the url /, which is the default url routing method of Wagtail, besides ////. However you have to replace the href content of all the entry links of the templates by href="{% pageurl entry %}" instead of the default Puput templatetag href="{% entry_url entry blog_page %}".

climu commented 5 years ago

Alright it was the special character in the slug. I removed it and it's fixed.

It's an open issue at puput.