Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
txp:title tag error with simple-pie
Decided to play around with the title of my pages, I wanted to test out the new section name output in the title.
I’ve added this at the top of the default page:
<code>
<txp:if_section name=”“>
<title><txp:page_title />: <txp:site_slogan /></title>
<txp:else />
<title><txp:page_title /></title>
</txp:if_section>
</code>
I’m getting this error on the top of only one of the sections:
<code>tag_error <txp:title/> -> Textpattern Notice: error_article_context on line 1818</code>
Section title: RSS Feeds
Error happens while in Testing mode, goes away in Live mode.
Last edited by Sencer (2006-09-15 18:18:05)
We Love TXP . TXP Themes . TXP Tags . TXP Planet . TXP Make
Offline
Re: txp:title tag error with simple-pie
Are you saying you get an error for <txp:title/> when you are not using it anywhere in your code?
Offline
Re: txp:title tag error with simple-pie
The only place that the title is used is in the default form:
<code><h3><txp:permlink><txp:title /></txp:permlink> <br /> <txp:posted /> by <txp:author /></h3></code>
The error popped up after I added the conditional for the page title, yeah I know it sounds strange.
Edit1: Ok, I took the conditionals for the page title out and I still get the error, been a long morning, I thought it was related.
Edit2: The error magically went away, maybe it was the afternoon cup of coffee ;)
Last edited by hcgtv (2006-09-13 19:40:49)
We Love TXP . TXP Themes . TXP Tags . TXP Planet . TXP Make
Offline
Re: txp:title tag error with simple-pie
The error returned this morning, turned on debugging mode:
Top of the page:
<pre>tag_error <txp:title/> -> Textpattern Notice: error_article_context on line 1818
textpattern/lib/txplib_misc.php:1818 trigger_error()
textpattern/publish/taghandlers.php:1773 assert_article()
textpattern/publish.php:956 title()
processtags()
textpattern/publish.php:915 preg_replace_callback()
textpattern/publish.php:454 parse()
index.php:28 textpattern()
</pre>
Here’s a link to the Tag trace, I tried to enter it here but it kept stripping out lines.
This particular section is using the SimplePie plugin to read in 4 feeds. I output one article on the top of the page and the feed tags are included in the default template. In Live mode nothing shows up but I normally have this site in Testing mode.
We Love TXP . TXP Themes . TXP Tags . TXP Planet . TXP Make
Offline
Re: txp:title tag error with simple-pie
Your problem is this:
[ ~~~ secondpass ~~~ ]
<txp:title/>
-->
Somewhere, probably one of the plugins, returns <txp:title> during the first parse() of the page. This is then parsed in the secondpass – where of course there is no context (read: no article-data) from where to return anything meaningful for that tag.
Last edited by Sencer (2006-09-14 14:25:25)
Offline
Re: txp:title tag error with simple-pie
Is there somewhere that explains first and second parses of a page?
I’ve looked at the plugin but I don’t see where it outputs a title tag but I’ll keep researching.
We Love TXP . TXP Themes . TXP Tags . TXP Planet . TXP Make
Offline
Re: txp:title tag error with simple-pie
There’s not that much to explain. There just used to be always two parse()-commands on the template (in textpattern()), as long as I could remember. It wasn’t removed because somebody might rely on it (in fact in 4.0.2/3 we made use of it for handling backwards-compatibility with certain comments-related stuff – though that will be gone due to the simplifications that have been in svn for a while and will appear in 4.0.4).
You could comment out the second parse() in textpattern(), and then look at the source of the page, where the title-tag appears.
Offline
Re: txp:title tag error with simple-pie
I decided to install on my Windows laptop the site in question so I could try out your suggestion.
- Imported this morning’s SQL backup
- Copied over the site’s file structure
- Set the local site to debugging mode
- Brought up the problem page, no error!
VPS specs: Apache 2.0.54 – MySQL 4.0.24 – PHP: 4.3.10-16
Local specs: Apache 2.0.58 – MySQL 5.0.21 – PHP 5.1.4
The only difference in the two sites is in the config files:
VPS: $txpcfg[‘dbcharset’] = ‘latin1’;
Local: $txpcfg[‘dbcharset’] = ‘utf8’;
Back to square one :)
We Love TXP . TXP Themes . TXP Tags . TXP Planet . TXP Make
Offline
Re: txp:title tag error with simple-pie
Solved the mystery, many cups of coffee later.
Seems like this forum post was the culprit. It contains <code><txp:title /></code> in the title and it was one of the active threads yesterday.
In the past I’ve used notextile in a post so I could print out a tag without it being executed, would this be the best way to accomplish this in the SimplePie plugin’s output?
We Love TXP . TXP Themes . TXP Tags . TXP Planet . TXP Make
Offline
Re: txp:title tag error with simple-pie
notextile is not going to prevent the function from being called. A plugin that is pulling in content from outside, should be properly escaping the output. Of course the use of html in the title-element of rss-feeds has been a point of much discussion for years now, and was among other things one of the reasons why atom was started, which makes it unmistakably clear how a title is to be handled. You’re a victim of the rss spec. The feed is ok, simple-pie is ok, and yet things are broken.
However you are lucky in that you definitely know that you do not want to have anything with < txp: in the stuff you are outputting on the page, so adapting the simple-pie plugin so that it escapes the output when the above string is encountered should solve your problem.
Last edited by Sencer (2006-09-15 18:30:12)
Offline
Pages: 1