Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-08-06 16:58:49

squaredeye
Member
From: Greenville, SC
Registered: 2005-07-31
Posts: 1,495
Website

Notice: error_article_context in ...lib/txplib_misc.php on line 1821

Any ideas what’s going wrong here?
I have the site set to live.

Here is my page

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html id="<txp:section />" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>

<title>Squared Eye Design : Error 404, Page not found</title>
<txp:output_form form="basic_javascript" />

<!--SIFR CSS-->
<link rel="stylesheet" href="<txp:site_url />sifr/sIFR-screen.css" type="text/css" media="screen" />
<link rel="stylesheet" href="<txp:site_url />sifr/sIFR-print.css" type="text/css" media="print" />
<!--CSS-->
<link rel="stylesheet" type="text/css" href="<txp:site_url />css/square.css" media="screen" />
<link rel="stylesheet" type="text/css" href="<txp:site_url />css/form.css" media="screen" />

<link rel="stylesheet" type="text/css" href="<txp:site_url />css/print.css" media="print" />
<link title="RSS" type="application/rss+xml" href="/rss/" rel="alternate"/>

<!--[if lte IE 7]>
<link rel="stylesheet" href="<txp:site_url />css/ie.css" type="text/css" media="screen" />
<![endif]-->
<!--FAVICON-->
<link rel="shortcut icon" href="<txp:site_url />css/images/favicon.ico" type="image/x-icon" />
</head>
<body id="error">

	<div id="header">
		<txp:output_form form="basic_nav" />
	</div>

	<div id="content" class="wrap">

		<div class="main-list">
			<div class="post zemError">
			<h3>Oops! It looks like you've landed on a page that doesn't exist</h3>
			<p><strong><txp:error_status /></strong><br />
<txp:error_message /></p>
			</div>
		</div><!--#main-->

				<div class="sub">
					<div class="sub-sect">
					<h3>Finding you're way around</h3>
					<p>If you'd like, you can choose to search below, or have a browse through the notebook categories if your prefer.</p>
					<p>Alternatively, if you feel that you've reached this page as a mistake on our part, please contact us so we can make sure it doesn't happen again.</p>
					<txp:search_input label="Search by Keyword" form="search_input" />
					</div>

					<div id="tag-list">
					<h3 id="tag">Notebook Category List</h3>
					<ul class="zebra">
						<txp:rss_uc_list linktosection="notebook" section="notebook" wraptag="" />
					</ul>
					</div>
				</div><!--sub-->

		<div class="clear">&nbsp;</div>
	</div><!--content-wrap-->
	<txp:output_form form="basic_footer" />

</body>
</html>

Last edited by ma_smith (2007-08-06 17:00:47)


Offline

#2 2007-08-06 17:04:32

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Notice: error_article_context in ...lib/txplib_misc.php on line 1821

What happens if you switch to ‘debug’ and what is in the three forms you use? Not sure what rss_uc_list does.

Last edited by ruud (2007-08-06 17:06:10)

Offline

#3 2007-08-06 17:10:22

squaredeye
Member
From: Greenville, SC
Registered: 2005-07-31
Posts: 1,495
Website

Re: Notice: error_article_context in ...lib/txplib_misc.php on line 1821

Ruud,
Nothing. Same error. No further errors commented in the HTML either?


Offline

#4 2007-08-06 17:25:27

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Notice: error_article_context in ...lib/txplib_misc.php on line 1821

Which TXP version are you using?

Try adding this line after the global statement in the assert_article function in txplib_misc.php (right after line 1819):

if (empty($thisarticle)) echo '<pre>'.escape_output(join("\n", get_caller(5,1))).'</pre>';

Offline

#5 2007-08-07 01:45:38

squaredeye
Member
From: Greenville, SC
Registered: 2005-07-31
Posts: 1,495
Website

Re: Notice: error_article_context in ...lib/txplib_misc.php on line 1821

Ruud,
I am now updated to 4.05. (so now the error reads: Notice: Article tags cannot be used outside an article context in /home/13956/domains/squaredeye.com/html/textpattern/lib/txplib_misc.php on line 1886)

Also, in case its of any interest, the error loads without css, and then the files populate. It seems to cause some slowing of the load of the page.

I tried to apply the line above so that it looked like this:

function get_caller($num=1,$start=2)
	{
		$out = array();
		if (!is_callable('debug_backtrace'))
			return $out;

		$bt = debug_backtrace();
		for ($i=$start; $i< $num+$start; $i++) {
			if (!empty($bt[$i])) {
				$t = '';
				if (!empty($bt[$i]['file']))
					$t .= relative_path($bt[$i]['file']);
				if (!empty($bt[$i]['line']))
					$t .= ':'.$bt[$i]['line'];
				if ($t)
					$t .= ' ';
				if (!empty($bt[$i]['class']))
					$t .= $bt[$i]['class'];
				if (!empty($bt[$i]['type']))
					$t .= $bt[$i]['type'];
				if (!empty($bt[$i]['function'])) {
					$t .= $bt[$i]['function'];

				$t .= '()';
				}


				$out[] = $t;
			}
		}
		return $out;
	}
	if (empty($thisarticle)) echo '<pre>'.escape_output(join("\n", get_caller(5,1))).'</pre>';

After doing that, I found the following results showed up on the page:

textpattern/publish.php:32 include_once()
index.php:33 include()

Offline

#6 2007-08-07 05:49:06

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

Re: Notice: error_article_context in ...lib/txplib_misc.php on line 1821

You need to put a call to get_caller() inside the assert_article() function, actually after line 1885.

Offline

#7 2007-08-07 08:39:44

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Notice: error_article_context in ...lib/txplib_misc.php on line 1821

^^ indeed, the line number is different because you’re using 4.0.5 instead of 4.0.4 now.

Offline

#8 2007-08-07 13:02:18

squaredeye
Member
From: Greenville, SC
Registered: 2005-07-31
Posts: 1,495
Website

Re: Notice: error_article_context in ...lib/txplib_misc.php on line 1821

Hey thanks Ruud and Mary,

I inserted it thus

	function assert_article() {
		global $thisarticle;
		if (empty($thisarticle))
			trigger_error(gTxt('error_article_context'));
		if (empty($thisarticle)) echo '<pre>'.escape_output(join("\n", get_caller(5,1))).'</pre>';
	}

and got the following error:


Notice: Article tags cannot be used outside an article context in /home/13956/domains/squaredeye.com/html/textpattern/lib/txplib_misc.php on line 1886
textpattern/publish/taghandlers.php:2428 assert_article()
textpattern/publish.php:963 permlink()
processTags()
textpattern/publish.php:922 preg_replace_callback()
textpattern/lib/txplib_misc.php:1383 parse()

so I turned on debugging again and ran it again but nothing changed. What should I expect to see?


Offline

#9 2007-08-07 13:08:56

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Notice: error_article_context in ...lib/txplib_misc.php on line 1821

It shows that it’s the use of <txp:permlink /> outside of article context (without explicitly specifying an ‘id’) that is causing the error.

Offline

#10 2007-08-07 13:49:29

squaredeye
Member
From: Greenville, SC
Registered: 2005-07-31
Posts: 1,495
Website

Re: Notice: error_article_context in ...lib/txplib_misc.php on line 1821

Ruud,
I’m having trouble figuring that one out.
The only use of permlink that might have been in there was a use of Rob Sable’s plugin (RSS_unlimited_categories). Even when I comment that out, I still get the error?

Even removing all instances of TXP tags I still get the error.

M


Offline

#11 2007-08-07 14:08:22

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Notice: error_article_context in ...lib/txplib_misc.php on line 1821

Does the tag trace show where permlink is used?

Offline

#12 2007-08-07 14:16:13

squaredeye
Member
From: Greenville, SC
Registered: 2005-07-31
Posts: 1,495
Website

Re: Notice: error_article_context in ...lib/txplib_misc.php on line 1821

Ruud,
I am not seeing a tag trace below the html like I am used to seeing, but with debugging on, I get this on every page:
(by the fact that its on every page, makes me think that it must be in a form, so I will go peeking around the misc forms),
although that still has me wondering how it could do that on a page that hasn’t got any TXP tags. (ie, the error page)

tag_error <txp:permlink/> ->  Textpattern Notice: Article tags cannot be used outside an article context  on line 1886

textpattern/lib/txplib_misc.php:1886 trigger_error()
textpattern/publish/taghandlers.php:2428 assert_article()
textpattern/publish.php:963 permlink()
processTags()
textpattern/publish.php:922 preg_replace_callback()
textpattern/lib/txplib_misc.php:1383 parse()
textpattern/publish/taghandlers.php:243 parse_form()
textpattern/publish.php:963 output_form()
processTags()
textpattern/publish.php:922 preg_replace_callback()

Last edited by ma_smith (2007-08-07 14:16:57)


Offline

Board footer

Powered by FluxBB