Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-03-09 06:38:05

Logoleptic
Plugin Author
From: Kansas, USA
Registered: 2004-02-29
Posts: 482

Duplicate search result appearing since 4.0.3 upgrade

After upgrading a client site from Txp 4.0.2 to 4.0.3, something strange started happening with the search results. A duplicate of the first “hit” began showing up at the bottom of the result list. Viewing the page source shows it to be completely separated from the ordered list that contains the other results. It’s as if it was just coughed up out of my search result Form for no reason at all. You can see this in action here and here.

Taking a look at the tag trace (which you can find here), it seems like Textpattern is resulting “false” for <txp:if_section name=""> (as it should), but then spitting out content as if the result had been “true”. This is my first shot at interpreting a tag trace, though, so I could be wrong.

Any experienced template troubleshooters out there who can lend me a hand?

Offline

#2 2006-03-11 15:46:05

Logoleptic
Plugin Author
From: Kansas, USA
Registered: 2004-02-29
Posts: 482

Re: Duplicate search result appearing since 4.0.3 upgrade

I just had a thought. Could this have something to do with the default section (i.e. section="") being used for search results out-of-the-box? I’m sending my searches to a “search” section instead.

Offline

#3 2006-03-11 16:56:37

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

Re: Duplicate search result appearing since 4.0.3 upgrade

As you can see in the tag-trace, there are two instances of txp:article that are called.
Once gets called when <txp:if_search> [<txp:if_search>: true] is evaluated. And the other instance is probably in the txp:else part of <txp:if_section name="">[<txp:if_section name="">: false].

Maybe this is what you want…?

<txp:if_search>
...article...
<txp:else />
<txp:if_section name="">
...article...
<txp:else />
...article...
</txp:if_section>
</txp:if_search>

In this case, there will always only be a single article-call executed.

Offline

#4 2006-03-12 01:27:46

Logoleptic
Plugin Author
From: Kansas, USA
Registered: 2004-02-29
Posts: 482

Re: Duplicate search result appearing since 4.0.3 upgrade

Perfect! Thanks again. :-)

Offline

Board footer

Powered by FluxBB