Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2012-03-05 22:35:40

giz
Member
From: New Zealand
Registered: 2004-07-26
Posts: 259
Website

Page shows as blank if I specify an article sort attribute

Strange one this:

TXP: 4.4.1

Delivering scores of articles from multiple sections without any problems, but when I add this to my TXP page template:

<txp:if_section name="members">
<txp:article sort="Title asc" />
</txp:if_section>

I get a blank page in Safari, and this in Chrome:

Error 324 (net::ERR_EMPTY_RESPONSE): The server closed the connection without sending any data.

I do this:

<txp:if_section name="members">
<txp:article sort="Posted asc" />
</txp:if_section>

and I get 3 articles (there should be hundreds of matches) – but at least I’m getting a page.

I do this:

<txp:if_section name="members">
<txp:article limit="100" />
</txp:if_section>

and I get 100 articles sorted as you’d expect… but not what I want, which is sorting by title.

This is what I’ve done thus far to find the issue:

  1. checked / repaired the MySQL database
  2. cloned everything onto my Mac to see if it was a server issue (it wasn’t)
  3. checked my code for the hundredth time to see that there isn’t a dumb unclosed tag or something
  4. disabled cnk_versioning to see if it is somehow getting in the way (it isn’t)
  5. enquired on the TXP forum to see if anyone has any bright ideas :-p

The only ‘thing’ about the ‘members’ section is that they were imported into the database from CSV using _ jmd_csv_. That all went without a hitch, or so I thought.

Anyone ever have this as a problem? Is there a magical ‘re-index’ MySQL query I can do that might help?

Thanks all…

Last edited by giz (2012-03-05 22:38:35)

Offline

#2 2012-03-06 09:02:10

Dragondz
Moderator
From: Algérie
Registered: 2005-06-12
Posts: 1,529
Website GitHub Twitter

Re: Page shows as blank if I specify an article sort attribute

hi

put your textapttern into debugging mode and see tagtrace to find what s going wrong!

Offline

#3 2012-03-06 09:10:43

giz
Member
From: New Zealand
Registered: 2004-07-26
Posts: 259
Website

Re: Page shows as blank if I specify an article sort attribute

Thanks Rabah. I tried, but there is no source code to see i.e. it’s all blank!

When I do get results, debug shows nothing amiss…

Offline

#4 2012-03-06 10:10:30

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,271
Website GitHub

Re: Page shows as blank if I specify an article sort attribute

Very weird behaviour. Can’t think of anything obvious off the top of my head. Some straws to clutch at:

  1. Check the first article (even the first few) that you expect to see in the alphabetical list with a very fine tooth comb. There may be something in the actual copy text that didn’t import properly and it’s causing Txp to bail out.
  2. In the database, check the body_html field of that article too (and excerpt_html too if there is one). Check everything looks reasonable (assuming it’s been Textiled on import).
  3. Be especially vigilant for characters you can’t see in the fields! If it came from a CSV and the articles in the members section were inserted in alphabetical order, there may have been an invisible first character like a BOM in the article text which is trashing the list when that article is viewed as the first one (you might not see the behaviour in a list sorted by Posted date, for example, as the offending article might be waaaay down the list).
  4. Test the theory that the first article is suspect by specifying offset="1" in the article tag. If it renders fine, it’s the 1st article causing the issue. Perhaps you could extend this test to skip 5 or 10 or 50 and see if the behaviour continues. If you find out at which point the list starts to render it’ll give you a starting point article to focus on. You can do the same sort of thing with limit: if it renders fine with sort="Title asc" limit="1" and no offset, then you know the 1st article is fine. Increase the limit in steps until the list breaks.
  5. (very long shot) Check your custom field names don’t clash with an article field, e.g. there isn’t one called ‘Title’ or ‘Order’ or something.

Past that I’m out of ideas at the moment. Hope some of that leads to an answer.

Last edited by Bloke (2012-03-06 10:15:43)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#5 2012-03-06 10:19:38

giz
Member
From: New Zealand
Registered: 2004-07-26
Posts: 259
Website

Re: Page shows as blank if I specify an article sort attribute

Stef: thank you hugely for the ammo. I’ll get stuck into it…

Offline

#6 2012-03-06 21:11:27

giz
Member
From: New Zealand
Registered: 2004-07-26
Posts: 259
Website

Re: Page shows as blank if I specify an article sort attribute

Problem sorted.

It was a combination of 2 issues:

1. The 4th article in the list had a badly formatted email tag:
p(email). <txp:email email='emailataddress.com>' linktext='emailataddress.com>' />

2. I use cnk_versioning so that I can work on my TXP templates via ftp using my favorite editing software, Coda: works a treat normally, but not on this particular server environment. It tells me that my change was uploaded to the server, but it is shitting me :-o No upload was actually made and/or cnk_versioning is misfiring in feeding the new changes into TXP. Still weird – Coda / cnk_versioning have been behaving themselves until now…

Anyhow, I hope my story helps others in a similar situation. Thank you again Stef: you’re a star.

See the work in progress at http://sistercities.org.nz/new

Offline

#7 2012-03-07 06:49:19

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,596
Website

Re: Page shows as blank if I specify an article sort attribute

It tells me that my change was uploaded to the server, but it is shitting me :-o No upload was actually made and/or cnk_versioning is misfiring in feeding the new changes into TXP

I sometimes get that problem, too. You can test if the file uploads by looking at it on the server and eyeballing whether it has updated 8-). If cnk_versioning is not doing its thing, check you are in test or debug mode (it does nothing in live mode) and if so, refresh the front end, then things should update.

If it’s not uploading (though it looks like it), try resetting the permissions for your template folders on your server (my host’s control panel has an option for that as a way to regain access to files which you can’t delete because some web process created them under its own ownership rather than the server’s. I think it is a CHOWN thing rather than CHMOD permissions). Thereafter it works for me.


TXP Builders – finely-crafted code, design and txp

Offline

Board footer

Powered by FluxBB