Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-03-27 23:06:56

andrewlkho
New Member
Registered: 2005-04-19
Posts: 7
Website

Pagination not working in sections

I’ve got a vanilla install of Textpattern 4.0.3 (no plugins), with essentially the following in my default page:

< txp:article limit=“5” />
< txp:older>Previous</txp:older>
< txp:newer>Next</txp:newer>

The links appear as expected. When I go to http://site/?pg=2 and so on, it works fine with the correct articles appearing. However, from http://site/section, the link for older articles takes me to http://site/section/?pg=2, which shows exactly the same page with the same link.

Has anyone had anything like this happen or know what might be the cause?

Thanks in advance,
— Andy

Edit: Ignore the extraneous spaces in the code: they’re there because it gets chewed up by the forum

Last edited by andrewlkho (2006-03-27 23:08:16)

Offline

#2 2006-03-27 23:48:54

zem
Developer Emeritus
From: Melbourne, Australia
Registered: 2004-04-08
Posts: 2,579

Re: Pagination not working in sections

<txp:older>Previous isn’t valid tag syntax.

Please read the FAQ before posting, particularly this and this.


Alex

Offline

#3 2006-03-28 00:07:37

KurtRaschke
Plugin Author
Registered: 2004-05-16
Posts: 275

Re: Pagination not working in sections


kurt@kurtraschke.com

Offline

#4 2006-03-28 00:15:57

andrewlkho
New Member
Registered: 2005-04-19
Posts: 7
Website

Re: Pagination not working in sections

Oh dear, that’s what I get for typing quickly when I’m tired. I did actually have those tags formed properly, as in with their closing tags (<txp:older>Previous</txp:older>). I still can’t work out what the problem is. Putting the site in Testing (or even Debugging) mode doesn’t throw up an error on the page (not even a comment in the HTML, which is where I presume errors are meant to appear — I can’t quite work that out).

Last edited by andrewlkho (2006-03-28 00:16:16)

Offline

#5 2006-03-28 00:57:52

zem
Developer Emeritus
From: Melbourne, Australia
Registered: 2004-04-08
Posts: 2,579

Re: Pagination not working in sections

Likely culprit is this.

Check your tag trace to make sure there really is an article tag on the page.

If that’s not it, we need more information, as per the FAQ.


Alex

Offline

#6 2006-03-28 10:05:32

andrewlkho
New Member
Registered: 2005-04-19
Posts: 7
Website

Re: Pagination not working in sections

Nope, I checked that and I’m definitely using txp:article rather than txp:article_custom.

As I said, I’m running Textpattern 4.0.3 without any plugins. It’s running on lighttpd proxied through Apache on TextDrive. Initially I thought that maybe the GET requests weren’t getting passed through by Apache, but if http://site/?pg=2 works, then they must be. The domain in question is pagalfind.com (at the moment I’ve changed it back to txp:article limit=15 so that all articles are visible).

So to recap (when <txp:article limit=5 /> is set):

  1. http://www.pagalfind.com/ gives me a correct “previous” link to http://www.pagalfind.com/?pg=2, which shows the correct thing
  2. http://www.pagalfind.com/latestnews show a correct “previous” link to http://www.pagalfind.com/latestnews/?pg=2, which just shows the same page when I click on it.

Oh, and I’m running with clean URL’s (/section/id/title), with server.error-handler-404 = "/index.php" in lighttpd’s configuration file.

That’s all the information I can think of that might be related.

Last edited by andrewlkho (2006-03-28 10:06:21)

Offline

#7 2006-03-28 10:53:10

zem
Developer Emeritus
From: Melbourne, Australia
Registered: 2004-04-08
Posts: 2,579

Re: Pagination not working in sections

Oh, and I’m running with clean URL’s (/section/id/title), with server.error-handler-404 = “/index.php” in lighttpd’s configuration file.

That could well be it. 404 handler clean URL’s aren’t well supported. Some servers don’t pass query strings on to PHP correctly. We don’t have much information about what does and doesn’t work.

Try putting this in your page template, and post the results from both of those ?pg=2 links:

<txp:php>dmp($_GET); dmp($GLOBALS['pretext']);</txp:php>

Alex

Offline

#8 2006-03-28 11:19:29

andrewlkho
New Member
Registered: 2005-04-19
Posts: 7
Website

Re: Pagination not working in sections

Right,

http://www.pagalfind.com/?pg=2 produces:

<pre>
Array
( [pg] => 2
)
1
Array
( [id] => [s] => default © => [q] => [pg] => 2 [p] => [month] => [author] => [request_uri] => /?pg=2 [qs] => pg=2 [subpath] => \/ [req] => /?pg=2 [status] => 200 [page] => default [path_from_root] => / [pfr] => / [path_to_site] => /users/home/andyho/domains/pagalfind.com/public_html [permlink_mode] => section_id_title [sitename] => pagal find [secondpass] =>
)
1
</pre>

http://www.pagalfind.com/latestnews/?pg=2 produces:

<pre>
Array
(
)
1
Array
( [id] => [s] => latestnews © => [q] => [pg] => [p] => [month] => [author] => [request_uri] => /latestnews/?pg=2 [qs] => [subpath] => \/ [req] => /latestnews/?pg=2 [status] => 200 [page] => default [path_from_root] => / [pfr] => / [path_to_site] => /users/home/andyho/domains/pagalfind.com/public_html [permlink_mode] => section_id_title [sitename] => pagal find [secondpass] =>
)
1
</pre>

This implies that the culprit is the fact that PHP is seeing a blank $_GET for the latestnews page — quite why this is I have no idea. I assume from this that Textpattern uses $_GET rather than $_REQUEST_URI and splicing that.

Can anyone suggest a workaround for this or have any other ideas?

Edit: I had to pre it to make it vaguely readable.

Last edited by andrewlkho (2006-03-28 11:20:23)

Offline

#9 2006-03-28 11:44:13

zem
Developer Emeritus
From: Melbourne, Australia
Registered: 2004-04-08
Posts: 2,579

Re: Pagination not working in sections

This implies that the culprit is the fact that PHP is seeing a blank $_GET for the latestnews page — quite why this is I have no idea.

The front page is handled normally by lighthttpd, and passed on to PHP. /latestnews/ doesn’t exist, so it’s handled as a 404 error. Apparently either lighttpd or PHP isn’t correctly handling $_GET on those pages.

If you don’t mind, could you try this on both pages also, please?

<txp:php>
dmp('request_uri: '.serverSet('REQUEST_URI'));
dmp('script_name: '.serverSet('SCRIPT_NAME'));
dmp('php_self: '.serverSet('PHP_SELF'));
dmp('query_string: '.serverSet('QUERY_STRING'));
</txp:php>

Thanks.

[edit: updated the code slightly to make it more readable]


Alex

Offline

#10 2006-03-28 12:08:37

Sencer
Archived Developer
From: cgn, de
Registered: 2004-03-23
Posts: 1,803
Website

Re: Pagination not working in sections

It’s running on lighttpd proxied through Apache

Can you try going directly to lighttpd by using the appropiate port, and see if that makes a difference. It’s just a wild guess, but maybe worth it. (Try if pagination works, then whether you get the same output as above for the dmp calls)

Offline

#11 2006-03-28 13:04:00

andrewlkho
New Member
Registered: 2005-04-19
Posts: 7
Website

Re: Pagination not working in sections

http://www.pagalfind.com/?pg=2 gives:

<code>
request_uri: /?pg=2
script_name: /index.php
php_self: /index.php
query_string: pg=2
</code>

&nbsp;

http://www.pagalfind.com/latestnews/?pg=2 gives:

<code>
request_uri: /latestnews/?pg=2
script_name: /index.php
php_self: /index.php
query_string:
</code>

&nbsp;

Everything is exactly the same if I go straight to lighttpd, so it’s not a problem with Apache and lighttpd communicating incorrectly. Thanks for the help so far on this one, guys.

Edit: fixed some formatting issues with the post

Last edited by andrewlkho (2006-03-28 13:06:21)

Offline

#12 2006-03-28 13:51:22

Sencer
Archived Developer
From: cgn, de
Registered: 2004-03-23
Posts: 1,803
Website

Re: Pagination not working in sections

query_string:

I know that this used to work (i.e. not be blank). Thus my advice would be to open up a ticket on txd and give them this information. Even if it’s not a configuration issue, I am sure they’ll be able to track down why the query-string is missing better than we can remotely. Please keep us updated on this. Thanks.

Offline

Board footer

Powered by FluxBB