Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-12-15 00:34:27

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Textpattern Notice: error_article_context on line 1822

Hi. When in debugging mode, I get the following in some pages.

tag_error <txp:title/> ->  Textpattern Notice: error_article_context  on line 1822

textpattern/lib/txplib_misc.php:1822 trigger_error(error_article_context)
textpattern/publish/taghandlers.php:1794 assert_article()
textpattern/publish.php:958 title(Array, , <txp:title />)
processtags(Array)
textpattern/publish.php:917 preg_replace_callback(/<txp:(\S+)\b(.*)(?:(?<!br )(\/))?>(?(3)|(.+)<\/txp:\1>)/sU, processTags, <txp:section title="1" />: <txp:title /> | <txp:sitename />: <txp:site_slogan />)
textpattern/publish/taghandlers.php:2278 parse(<txp:section title="1" />: <txp:title /> | <txp:sitename />: <txp:site_slogan />)
textpattern/publish.php:958 if_individual_article(Array, <txp:section title="1" />: <txp:title /> | <txp:sitename />: <txp:site_slogan />, <txp:if_individual_article><txp:section title="1" />: <txp:title /> | <txp:sitename />: <txp:site_slogan /></txp:if_individual_article>)
processtags(Array)
textpattern/publish.php:917 preg_replace_callback(/<txp:(\S+)\b(.*)(?:(?<!br )(\/))?>(?(3)|(.+)<\/txp:\1>)/sU, processTags, 

What does it mean?
Thanks!


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#2 2006-12-15 03:42:26

dbulli
Member
Registered: 2004-11-22
Posts: 195
Website

Re: Textpattern Notice: error_article_context on line 1822

Means that you are using a <txp:body /> out of context.

Example in a presentation page thats not inside if_individual_article,
Or maybe in a wrong type of form ??

You can read about it Txp:body /

Last edited by dbulli (2006-12-15 03:50:05)


nuff-respec ::: dannyb

Offline

#3 2006-12-15 04:01:59

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: Textpattern Notice: error_article_context on line 1822

Hi dbulli.
Thanks for your reply.

I think I’m using <txp:title /> in the right context.
The snippet is this:
<h1><txp:if_individual_article> <span><txp:section title=1 />: <txp:title /> | <txp:sitename />: </span><txp:site_slogan /></txp:if_individual_article><txp:if_article_list><txp:if_section name=""><span><txp:sitename />: </span><txp:site_slogan /><txp:else /><span><txp:section title=1 /> | <txp:sitename />: </span><txp:site_slogan /></txp:if_section></txp:if_article_list></h1>

There, txp:title is only used when in individual article context.
Also, the type of form doesn’t has any effect in the form functionality. The type is just used for categorization purposes, so that should be a problem.

Also, the output of the page in Production mode is totally correct. There seems to be no error at all.
I think the notice isn’t right. Could it be?


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#4 2006-12-15 04:15:51

dbulli
Member
Registered: 2004-11-22
Posts: 195
Website

Re: Textpattern Notice: error_article_context on line 1822

Sorry I did mean txp:title not txp:body … your code works for me when i put it in a presentation page, but if the form is not type “ARTICLE” … it will not work … MISC causes this error …

Last edited by dbulli (2006-12-15 04:16:24)


nuff-respec ::: dannyb

Offline

#5 2006-12-15 04:21:46

dbulli
Member
Registered: 2004-11-22
Posts: 195
Website

Re: Textpattern Notice: error_article_context on line 1822

SORRY .. i tried MISC and that worked .. only doesn’t work when i put it in without if_individual_article … does the tag trace show anything ?


nuff-respec ::: dannyb

Offline

#6 2006-12-15 04:35:43

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: Textpattern Notice: error_article_context on line 1822

Thanks again dbulli.

This is the tag trace

<!-- txp tag trace: 
[SQL (0,000676): select name from txp_lang where lang='es-es' limit 1]
[SQL (0,005581): select name, data from txp_lang where lang='es-es' AND ( event='public' OR event='common')]
[SQL (0,003521): select name, code, version from txp_plugin where status = 1]
[SQL (0,000634): select ID,Section from textpattern where url_title like 'todos-los-pedales-de-cluster' AND Section='acerca-de' and Status >= 4 limit 1]
[SQL (0,000603): select * from txp_section where name = 'acerca-de' limit 1]
[SQL (0,000545): select *, unix_timestamp(Posted) as uPosted from textpattern where ID=20 and Status = 4]
[SQL (0,000548): select user_html from txp_page where name='acerca-de']
[Página: acerca-de]
<txp:output_form form="head" />
	[SQL (0,000543): select Form from txp_form where name='head']
	[Formulario: head]
	<txp:if_individual_article>
		[<txp:if_individual_article>: true]
		<txp:section title="1" />
			[SQL (0,000300): select title from txp_section where name='acerca-de']
		<txp:title/>
		<txp:sitename/>
		<txp:site_slogan/>
	</txp:if_individual_article>
	<txp:if_article_list>
		[<txp:if_article_list>: false]
	</txp:if_article_list>
	<txp:kml_flashembed_js/>
	<txp:css/>
	<txp:if_section name="efectos,modificaciones">
		[<txp:if_section name="efectos,modificaciones">: false]
	</txp:if_section>
	<txp:if_section name="contacto">
		[<txp:if_section name="contacto">: false]
	</txp:if_section>
	<txp:if_section name="artistas-y-amigos">
		[<txp:if_section name="artistas-y-amigos">: false]
	</txp:if_section>
	<txp:if_section name="blog">
		[<txp:if_section name="blog">: false]
	</txp:if_section>
	<txp:css n="ie" />
	<txp:section/>
	<txp:link_to_home>
	</txp:link_to_home>
	<txp:anc_hide>
	</txp:anc_hide>
	<txp:if_individual_article>
		[<txp:if_individual_article>: true]
		<txp:section title=1 />
		<txp:title/>
		<txp:sitename/>
		<txp:site_slogan/>
	</txp:if_individual_article>
	<txp:if_article_list>
		[<txp:if_article_list>: false]
	</txp:if_article_list>
	<txp:cbs_navigation_menu titles="Nuestros efectos,Modificaciones,Cables y accesorios,Artistas y amigos" sections="efectos,modificaciones,cables-y-accesorios,artistas-y-amigos"   wraptag="ul" break="li" activeclass="active" />
	<txp:cbs_navigation_menu titles="Acerca de Cluster,Contactanos,Blog" sections="acerca-de,contacto,blog"    wraptag="ul" break="li" activeclass="active" />
<txp:article status="sticky" ubicacion="principal" form="estatico_pri" sortby="Posted" sortdir="asc" limit="1" />
	[SQL (0,000674): select *, unix_timestamp(Posted) as uPosted from textpattern where ID = 20 and Status = 5 limit 1]
	[artículo 20]
	[SQL (0,000265): select Form from txp_form where name='estatico_pri']
	[Formulario: estatico_pri]
	<txp:custom_field name="idclass" />
	<txp:title/>
	<txp:body/>
<txp:article_custom status="sticky" ubicacion="principal" form="titulo_link" sortby="Posted" sortdir="asc" />
	[SQL (0,001592): select *, unix_timestamp(Posted) as uPosted from textpattern where 1 and Status = 5 and Posted <= now() and custom_10 like 'principal'  order by Posted asc limit 0, 10]
	[SQL (0,000290): select Form from txp_form where name='titulo_link']
	[Formulario: titulo_link]
	[artículo 14]
	<txp:permlink>
		<txp:title/>
	</txp:permlink>
	[artículo 20]
	<txp:permlink>
		<txp:title/>
	</txp:permlink>
	[artículo 27]
	<txp:permlink>
		<txp:title/>
	</txp:permlink>
	[artículo 31]
	<txp:permlink>
		<txp:title/>
	</txp:permlink>
<txp:output_form form="pie" />
	[SQL (0,000295): select Form from txp_form where name='pie']
	[Formulario: pie]
	<txp:kml_flashembed movie="/images/elefante.swf" height="175" width="175" />
	<txp:link_to_home>
	</txp:link_to_home>
	<txp:section name="contacto" title="1" link="y" />
		[SQL (0,000342): select title from txp_section where name='contacto']
	<txp:poe_bbclone/>
		[SQL (0,000291): select Title from textpattern where ID = 20]
[ ~~~ secondpass ~~~ ]
 -->

It seems to be everything fine, am I right?

BTW: about the importance of form types

Last edited by maniqui (2006-12-15 04:36:08)


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#7 2006-12-15 04:52:07

dbulli
Member
Registered: 2004-11-22
Posts: 195
Website

Re: Textpattern Notice: error_article_context on line 1822

Looks fine by me … sorry of no help .. how curious .. i tried the same exact thing in a form and it all worked with no errors in list or single article…

all i can say is that the
bc. <txp:section title=“1” /> [SQL (0,000300): select title from txp_section where name=‘acerca-de’]

I did not have that SQL call in my debug … might that somehow might be causing problemos? Either way your code seems fine…


nuff-respec ::: dannyb

Offline

#8 2006-12-15 08:48:54

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

Re: Textpattern Notice: error_article_context on line 1822

There, txp:title is only used when in individual article context.

You misunderstood the message. Those variables can only be used, once they are initialized. And they are initialized when you use an article-tag – that is what is meant by the context.

A posible solution might be: If you have auto-append comments off, you can use two article-tags – one to display only the title (with the appropiate form references in the article-tag), and one to output the rest.

Offline

#9 2006-12-15 14:23:07

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: Textpattern Notice: error_article_context on line 1822

Thanks, Sencer. Few questions arises…

Sencer wrote:

A posible solution might be: If you have auto-append comments off, you can use two article-tags – one to display only the title (with the appropiate form references in the article-tag), and one to output the rest.

That’s what I used to do before 4.0.4, using something like <txp:article form="title" />1.
But as I understand, since 4.0.4, article tags (txp:body, txp:title, etc) can be included directly in individual article page templates without the needing of calling them using an extra txp:article tag.

Sencer wrote:

Those variables can only be used, once they are initialized. And they are initialized when you use an article-tag.

  1. So, do I have to initialize them with a txp:article tag even when 4.0.4 supports specific article tags directly in individual article pages?
  2. In that case, could a txp:article pgonly=1 used before any specific-article-tag (title, body) be enough to initialize the variables in individual-article context?
  3. If not, what’s the benefit of that new feature in 4.0.4? Tags/information like txp:title/title (or custom fields) are usually needed in top places in the page template (example: in the head), that are usually before any article-tag.

1 The disadvantages of this method are: 1. that you need extra article forms just for calling one variable and 2. there are problems if you specify an override form for a particular article.


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#10 2006-12-15 14:25:27

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: Textpattern Notice: error_article_context on line 1822

And they are initialized when you use an article-tag…

Which version of Textpattern is he using?

In 4.0.3 that was true; it’s not in 4.0.4. Article data is now populated before that, when you simply request an individual article url. If he is using 4.0.4, the if_individual_article tag should be suppressing the warning for other contexts and display properly in an individual article page. He should only be receiving the notice “Page template archive does not contain a txp:article tag”. I have double-checked this in both 4.0.4 and svn and cannot replicate there.

(And yes: at least in 4.0.x, form types are completely irrelevant – that info is only used by the tagbuilder. Some plugins might care, but the core does not.)

Offline

#11 2006-12-15 16:04:10

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: Textpattern Notice: error_article_context on line 1822

Hi Mary.

Thanks for your reply.
I’m using 4.0.4.

I think I have found a bug (a little one). I will try to explain it so you can replicate it.

Short explanation: it’s triggered when the individual article is an sticky article. When, in an individual and sticky article context, specific article tags (body, title, etc) are used directly in page template, they drop the above error (in debugging mode) and don’t work at all (= there is no output, for example, for txp:title when the article is sticky).

Please, tell me if you can replicate. If not, I will try to go for a long explanation.
Thanks.


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#12 2006-12-15 16:40:03

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: Textpattern Notice: error_article_context on line 1822

Perhaps you have. What’s weird is that it looks like it was done on purpose.

To fix it is simple, but we should wait until we can ask Alex about it.

Offline

Board footer

Powered by FluxBB