Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2017-04-28 14:07:22

Vienuolis
Member
From: Vilnius, Lithuania
Registered: 2009-06-14
Posts: 106
Website

<txp:link_to_prev /> warning

Shame on me, I have got a tag error on a quite simple form:

Tag error: <txp:link_to_prev /> ->  Notice: Undefined variable: expired parsing form takas-foto on page photos

And three subsequent variables: expired, id, time, keywords, also warned twice.

No need for such variables in this query, IMO. I do not catch, why and where they came from? Article ID is already retrieved before parsing <txp:link_to_prev />:

     34,44 |     9,79 | 	<txp:output_form form="takas-foto" />
     34,62 |     0,20 | 		[SQL: SELECT Form FROM txp_form WHERE name = 'takas-foto' ]
     34,84 |          | 		[Rows: 1]
     34,88 |          | 		[Form: 'takas-foto']
     34,90 |          | 		[Nesting forms: 'takas-foto']
     35,16 |     0,74 | 		<txp:section title="1" link="1" />
     35,45 |     0,27 | 			[SQL: SELECT title FROM txp_section WHERE name = 'photos' ]
     35,74 |          | 			[Rows: 1]
     35,94 |     0,05 | 		<txp:article_id />
     36,01 |     7,85 | 		<txp:link_to_prev />
     36,09 |          | 			[filterAtts not set]
     36,74 |          | 			Tag error: <txp:link_to_prev /> -> Notice: Undefined variable: expired parsing form <strong>takas-foto</strong> on page <strong>photos</strong>
     37,20 |          | 			Tag error: <txp:link_to_prev /> -> Notice: Undefined variable: id parsing form <strong>takas-foto</strong> on page <strong>photos</strong>
     37,64 |          | 			Tag error: <txp:link_to_prev /> -> Notice: Undefined variable: id parsing form <strong>takas-foto</strong> on page <strong>photos</strong>
     38,04 |          | 			tag error: <txp:link_to_prev /> -> Notice: Undefined variable: time parsing form <strong>takas-foto</strong> on page <strong>photos</strong>
     38,44 |          | 			Tag error: <txp:link_to_prev /> -> Notice: Undefined variable: time parsing form <strong>takas-foto</strong> on page <strong>photos</strong>
     38,90 |          | 			Tag error: <txp:link_to_prev /> -> Notice: Undefined variable: keywords parsing form <strong>takas-foto</strong> on page <strong>photos</strong>
     39,51 |          | 			Tag error: <txp:link_to_prev /> -> Notice: Undefined variable: keywords parsing form <strong>takas-foto</strong> on page <strong>photos</strong>

..and so on. It is stranger, that <txp:link_to_next /> and even <txp:prev_title /> are parsed correctly with no warnings. I do not find any syntax mistakes in my breadcrumb form „takas-foto“ for a page template „photos“:

		<footer id="takas">
	<nav>
<a href="/">Kaluva</a> &raquo;
<txp:section title="1" link="1" /> &raquo;
<txp:article_id /> nr.
	</nav>
	<div>
<a href="<txp:link_to_prev />" title="<txp:prev_title />">◀</a>
&nbsp; kitas &nbsp;
<a href="<txp:link_to_next />" title="<txp:next_title />">▶</a>
	</div>
		</footer><!-- takas -->

The form is inside txp:if_individual_article context of a page. I even tried it inside txp:article tag — nothing helped. It looks like non-critical error, because navigation by both „Previous – Next“ works correctly, and these warnings are visible in debug mode only.

Textpattern v4.6.2, kaluva.on.lt/uzvencio-krastotyros-muziejuje (the section template is still not made).

Last edited by Vienuolis (2017-04-29 06:38:08)

Offline

#2 2017-04-29 08:12:42

jakob
Moderator
From: Germany
Registered: 2005-01-20
Posts: 2,578
Website

Re: <txp:link_to_prev /> warning

Sorry, no idea on this. It may apply to any of the next/prev tags but only shows on link_to_prev because that’s the first tag it encounters and after the first tag, the required article data then exists for the following tags. You can test that by changing the order of the tags temporarily in your form. That doesn’t help you further, though.

As far as I can tell, your site still works correctly, despite the warnings?

There have been some relevant-sounding updates to the underlying function since 4.6.2 (for example) but I’m not sure you can make those edits, as quite a few other aspects changed around the same time. Oleg / etc will be able to provide more information…


TXP Builders – finely-crafted code, design and txp

Offline

#3 2017-05-02 04:48:38

Vienuolis
Member
From: Vilnius, Lithuania
Registered: 2009-06-14
Posts: 106
Website

Re: <txp:link_to_prev /> warning

jakob wrote #305548:

your site still works correctly, despite the warnings?

Yes. I have made a template for an article list, too, but the warning remained and I still not found my mistake.

I wonder, is not some TxP glitch here — where, why and how TxP is dependent on Apache webserver? Why false warning Clean URL test failed is displayed in the Diagnostic panel on non-Apache webservers (Cherokee, Hiawatha, Lighttp, NginX, etc.)?

P. S. I have never used Next-Prev before.

Last edited by Vienuolis (2017-05-02 05:07:55)

Offline

#4 2017-05-02 05:43:45

bici
Member
From: vancouver
Registered: 2004-02-24
Posts: 1,058
Website

Re: <txp:link_to_prev /> warning

Vienuolis wrote #305578:

P. S. I have never used Next-Prev before.

here is what i have for previous / next in case it might be of any help:

<txp:if_individual_article>
<txp:link_to_prev><txp:prev_title /> << </txp:link_to_prev>
<txp:link_to_next><txp:next_title />  >> </txp:link_to_next>

</txp:if_individual_article>
<txp:if_article_list>

<txp:older> <<  Previous </txp:older> &nbsp; | &nbsp;
<txp:newer> Next  >> </txp:newer>

</txp:if_article_list>

…. texted postive

Offline

#5 2017-05-02 17:32:15

Vienuolis
Member
From: Vilnius, Lithuania
Registered: 2009-06-14
Posts: 106
Website

Re: <txp:link_to_prev /> warning

Horray! My fellow Rimas just fixed this TxP issue! For me, and made a pull request on Github. Cheers!

Offline

#6 2017-05-03 10:18:59

etc
Developer
Registered: 2010-11-11
Posts: 2,240
Website

Re: <txp:link_to_prev /> warning

The problem (imo) comes from <txp:link_to_prev /> parsed before <txp:article />. Awaiting a better solution, try to place your <footer id="takas" /> inside nuotrauka form.


etc_[ query | search | pagination | date | tree | cache ]

Offline

#7 2017-05-03 18:56:52

Vienuolis
Member
From: Vilnius, Lithuania
Registered: 2009-06-14
Posts: 106
Website

Re: <txp:link_to_prev /> warning

Sorry, I do not quite catch your point. Navigation worked correctly, despite false warnings, though. And all the warnings are gone away now, after Rimas’ patch.

Offline

#8 2017-05-04 09:02:53

etc
Developer
Registered: 2010-11-11
Posts: 2,240
Website

Re: <txp:link_to_prev /> warning

Vienuolis wrote #305603:

Sorry, I do not quite catch your point. Navigation worked correctly, despite false warnings, though. And all the warnings are gone away now, after Rimas’ patch.

I think it works only because you are using the default (Posted DESC) sort order. If you try <txp:article sort="Title" />, for example, the next/prev links will be wrong (if I’m right). This said, we are grateful to Rimas for the patch and will apply it after some reworking.


etc_[ query | search | pagination | date | tree | cache ]

Offline

#9 2017-05-04 09:39:33

Vienuolis
Member
From: Vilnius, Lithuania
Registered: 2009-06-14
Posts: 106
Website

Re: <txp:link_to_prev /> warning

I caught your idea, thanks for explanation.

Offline

Board footer

Powered by FluxBB