Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2023-12-29 12:15:50

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,135
Website

Incorrect output for txp:newer and txp:older (?)

TBC, but Something Odd is going on I think with <txp:newer /> and <txp:older />

TXP 4.9-dev + PHP 8.3.1

Input (list page template):

<txp:evaluate test>
  <link rel="prev" href="<txp:newer />">
</txp:evaluate>
<txp:evaluate test>
  <link rel="next" href="<txp:older />">
</txp:evaluate>

actual output:

<link rel="prev" href="<a href="http://txp.local/playground/?pg=2">2</a>">
<link rel="next" href="<a href="http://txp.local/playground/?pg=4">4</a>">

expected output:

<link rel="prev" href="http://txp.local/playground/?pg=2">">
<link rel="next" href="http://txp.local/playground/?pg=4">">

Similar example in use on the blog section of textpattern.com; code here

If I insert this in the <body /> – nearly verbatim the example in the docs,

<p>test: newer <txp:newer /> and older (1) <a href="<txp:older />">foo</a> and(2) <txp:older>foobar</txp:older> and(3) <txp:older />

output is not exactly what I expected:

<p>test: newer <a href="http://txp.local/playground/?pg=2">2</a> and older (1) <a href="<a href="http://txp.local/playground/?pg=4">4</a>">foo</a> and(2) <a href="http://txp.local/playground/?pg=4">foobar</a> and(3) <a href="http://txp.local/playground/?pg=4">4</a>

–^–

This is I think fairly recent, might be this commit [???]

BTW – hard to reproduce on the dev-demo site, as that has only one page for the section


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

#2 2023-12-29 17:30:42

etc
Developer
Registered: 2010-11-11
Posts: 5,129
Website GitHub

Re: Incorrect output for txp:newer and txp:older (?)

Yep, it’s a regression. Will fix, thank you.

Offline

#3 2024-01-02 15:18:20

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,626
GitHub Twitter

Re: Incorrect output for txp:newer and txp:older (?)

… Same behavior with this:

<txp:evaluate test='<txp:images type="caption" />'>No results...</txp:evaluate>


Patrick.

Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.

Offline

#4 2024-01-02 20:10:34

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

Re: Incorrect output for txp:newer and txp:older (?)

Pat64 wrote #336276:

… Same behavior with this:

<txp:evaluate test='<txp:images type="caption" />'>No results...</txp:evaluate>

I may be wrong but my understanding is that testing for the results of an expression needs to use the query attribute and that test was for specifying which txp:tag in a container is the relevant one to test against.

Also the type attribute is only for txp:image_info. For the negative result, you also need either the not attribute, or the txp:else case.


TXP Builders – finely-crafted code, design and txp

Offline

#5 2024-01-03 02:59:57

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,626
GitHub Twitter

Re: Incorrect output for txp:newer and txp:older (?)

You are right!
I forgot the needed query attribute (see here: https://forum.textpattern.com/viewtopic.php?pid=332047#p332047)…

Last edited by Pat64 (2024-01-03 03:00:15)


Patrick.

Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.

Offline

#6 2024-01-09 03:08:32

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,135
Website

Re: Incorrect output for txp:newer and txp:older (?)

etc wrote #336248:

Yep, it’s a regression. Will fix, thank you.

I see you fixed it nicely. That works smoothly now. Thank you.


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

Board footer

Powered by FluxBB