Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2012-09-24 17:14:59

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

Notice: Article tags cannot be used outside an article context

Tag error: <txp:some_article_tag /> -> Textpattern Notice: Article tags cannot be used outside an article context on line 2325

In a similar line of thinking that what’s discussed this thread, could we get rid of that notice? Maybe via some yes/no option on Preferences?

I develop in “Testing” mode. I get that an article tag on a non-article context will “fail”. Thankfully, it just returns empty, which I think it’s a Good Thing, even when Zen of Python suggests that errors should never pass silently, but I don’t consider this is an error/bug, but a feature :)

Thanks.


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#2 2012-09-27 09:29:04

merz1
Member
From: Hamburg
Registered: 2006-05-04
Posts: 994
Website

Re: Notice: Article tags cannot be used outside an article context

What about test/debug verbose levels in the next TXP versions?
For me the dropdown translates to v=0,1,2 anyway :)

Btw: Can those modes be made user dependent?


Get all online mentions of Textpattern via OPML subscription: TXP Info Sources: Textpattern RSS feeds as dynamic OPML

Offline

#3 2012-09-27 09:34:05

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,328
Website Mastodon

Re: Notice: Article tags cannot be used outside an article context

merz1 wrote:

Btw: Can those modes be made user dependent?

They are already, kind of: Their verbosity depends upon a user’s privilege level. See debug.verbose and debug.backtrace here.

We can of course expand on that scheme. What do you consider a sensible solution for some permutations of privilege levels and production modes?

Offline

#4 2012-09-27 11:23:21

merz1
Member
From: Hamburg
Registered: 2006-05-04
Posts: 994
Website

Re: Notice: Article tags cannot be used outside an article context

  1. Case: ‘User dependent’ translates mainly to if_logged_in. Making small changes on a ‘live’ site I – logged in as admin – sometimes wish to see debug messages while anonymous website visitors won’t. Possible?
  2. Case: More granularity. Enable debug mode for single/multiple forms and/or pages (and/or articles?) only. Could be a simple on/off switch. Does that make sense?

Regarding the levels v=0,1,2 I am totally fine but maniqui shows a good example. For my case 2 a v=0,2 switch would be sufficient. Others may want an addition recursive=on,off switch.

Edit: Before thinking of an admin-UI ‘switch’ I was thinking of a txp:tag like txp:debug verbose="2" recursive="on" userlevel="admin" output="URL". Container mode checks code fragments, single mode checks form/page/article.

Last edited by merz1 (2012-09-27 11:29:51)


Get all online mentions of Textpattern via OPML subscription: TXP Info Sources: Textpattern RSS feeds as dynamic OPML

Offline

#5 2012-09-28 07:30:53

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,328
Website Mastodon

Re: Notice: Article tags cannot be used outside an article context

I’ve filed issue 272 to track this request.

Offline

Board footer

Powered by FluxBB