Categories next page not working in 2.0

Found a bug? Tell us!!
Post Reply
latcarf
Regular
Posts: 25
Joined: Tue Apr 12, 2005 1:21 am
Location: Silicon Valley, CA
Contact:

Categories next page not working in 2.0

Post by latcarf »

Hi all,

When I go to http://myblog_domain/categories/ I see a page with the first 25 of all the entries in my blog. The footer has a link for "next" page which is http://myblog_domain/categories/P2.html but when I click on that, it still shows the first 25 entries (i.e. page 1). Except, on this new page, the link is now http://myblog_domain/categories/P2/P2.html (note the extra P2 in the url). Click it again and you see the first 25 entries again but the link is now: http://myblog_domain/categories/P2/P2/P2.html

I expect this is a problem with the redirects in .htaccess (yes, we're using regular Apache mod_rewrite option for URL rewrites) and this is a problem both in a blog upgraded from 1.7 to 2.0 and on one that started life as 2.0. Anyone have some insight into the issue?

Thanks!!
onli
Regular
Posts: 2825
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

Re: Categories next page not working in 2.0

Post by onli »

No further insights that, but I can confirm the bug. Is /categories a valid page?
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Re: Categories next page not working in 2.0

Post by yellowled »

onli wrote:Is /categories a valid page?
If you change the name “categories” like I did in my blog, both the page for (just) the new and the original name (http://yellowled.de/thema vs http://yellowled.de/categories) throw a 404 (in my case at least).

YL
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: Categories next page not working in 2.0

Post by Timbalu »

I assume you did not carefully read the upgrader notes (somewhere in/with early 1.7.x), wanting you to manually change some things, when using specific themes like bulletproof as a copy template.
Please follow: http://board.s9y.org/viewtopic.php?f=3& ... p=10436169

If that is not the case, you have a problem with htaccess. Show us its content and also clear if you have another htaccess file in the domain root, which might interfere badly.
Also see that http://blog.latcarf.com/categories/ gives an empty page with an echoed index.php string. This should not happen and fall down to the 404 error defined page (defined in htaccess or by the staticpage plugin), which normally is just the blogs root /index.php file.
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
onli
Regular
Posts: 2825
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

Re: Categories next page not working in 2.0

Post by onli »

Ian, i have the same error in my blog: https://www.onli-blogging.de/categories/. Klick through to the next page and then again to the following. This is not an user error.
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: Categories next page not working in 2.0

Post by Timbalu »

Hmm, right! (The latcarf blog 404 fallback echoed "index.php" string is, though!)

Ok. Lets see.
We have category links like such:

Code: Select all

/categories/1-firstcat
/categories/2-othercat
You normally never have a link like this "/categories/" or "/categories", empty alone.

The htaccess works as follow:

Code: Select all

ErrorDocument 404 {PREFIX}{indexFile}
...
RewriteRule ^({PAT_PERMALINK_CATEGORIES}) {indexFile}?/$1 [NC,L,QSA]
RewriteRule ^{PAT_ARCHIVES} {indexFile}?url=/{PATH_ARCHIVES}/$1.html [NC,L,QSA]
...
If you need to have access to an empty "/categories/" link, stopping you from falling back to the index.page, you need to set a staticpage 404 page, via the staticpage options. This works! (And is the case at YLs blog too, I assume.)

Or write an exception for the categories case to the entries pagination function. I would not think disabling the categories rewrite rule in the htaccess would help here without breaking something else.

I think you just need to decide what you want (normal behaviour is what you have on your blog, Onli).
A directory link without specific category id-name does not happen.
If you really want it, you would need a own index file, which is what a defined staticpage 404 does.

All other behaviour works well http://blog.latcarf.com/categories/1-Computing/P3.html etc pp.
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Re: Categories next page not working in 2.0

Post by yellowled »

Timbalu wrote:If you need to have access to an empty "/categories/" link, stopping you from falling back to the index.page, you need to set a staticpage 404 page, via the staticpage options. This works! (And is the case at YLs blog too.)
I do not have a staticpage 404 page. However, my index.tpl contains

Code: Select all

{if $view == '404'} … {/if}
which is probably the same, technically.

YL
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: Categories next page not working in 2.0

Post by Timbalu »

Yeah. I didn't mention that specifically, but it is technically the same approach.
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
onli
Regular
Posts: 2825
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

Re: Categories next page not working in 2.0

Post by onli »

Okay. Hoping I understand that right, if /categories is not a valid page, I would not count this as a real bug. I expected this to be an alternative page to show all articles from all categories.

But it is still strange behaviour. To properly fail there with a hard 404 would be better.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Categories next page not working in 2.0

Post by garvinhicking »

Hi!

Yeah, /categories/ alone was never meant to be a proper view; "all articles from all categories" would be the blog / itself :)

Of course I agree that in this case the 404 view would need to be triggered, though...
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Post Reply