Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-06-22 13:40:51

lothar99
Member
Registered: 2009-03-20
Posts: 35

Hidding Errors

I posted about this before and Els gave me the solution. I was having a tag error….. which goes away if the site is in live mode.

However, I have now started using rvm_privileged to protect content… but it doesn’t show protected content even when logged in in firefox (works in IE though) when the site is in Live mode. It works in debugging and testing modes though.

Are there other ways to hide tag errors?

Here is the tag error:
Tag error: -> Textpattern Notice: Page template default2 does not contain a txp:article tag on line 504

It occurs if someone tries to go to a protected article (not if they try to go to a protected section) while not logged in. I would guess it is because it is expecting an article tag due to the url but when it gets there that portion of the code is hidden due to protection.

I also have another error that I doubt anyone would ever see … unless they went to the page by guessing url or something weird.. but it still would be nice to hide it…. WARNING: array_filter() [function.array-filter]: The first argument should be an array in line 208 of file check.inc.php

Also if anyone has any ideas on why the plugin would act that way then let me know!

Thanks!

Last edited by lothar99 (2009-06-22 13:42:02)

Offline

#2 2009-06-22 13:55:51

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,454
Website GitHub

Re: Hidding Errors

lothar99 wrote:

Page template default2 does not contain a txp:article tag on line 504

Yes you are right in your diagnosis; it’s a bit of a pain. I’ve had the same thing using ign_pw_protect and I got round it by putting this in the <txp:else /> branch of my <txp:ign_if_logged_in /> conditional:

<txp:article pgonly="1" />

to ‘fake’ an article call.

No idea about the other error, sorry.

Last edited by Bloke (2009-06-22 13:56:37)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#3 2009-06-22 14:11:52

lothar99
Member
Registered: 2009-03-20
Posts: 35

Re: Hidding Errors

Thanks for the quick response. The fix makes sense… but unfortunately its actually displaying the article when I place that tag on the page.

Offline

#4 2009-06-22 14:14:58

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,454
Website GitHub

Re: Hidding Errors

lothar99 wrote:

The fix makes sense… but unfortunately its actually displaying the article when I place that tag on the page.

?? What does your tag trace say? Any clues in there?

Last edited by Bloke (2009-06-22 14:15:31)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#5 2009-06-22 14:20:53

lothar99
Member
Registered: 2009-03-20
Posts: 35

Re: Hidding Errors

what’s a tag trace?

this is the error:

Tag error: -> Textpattern Notice: Page template default2 does not contain a txp:article tag on line 504

Offline

#6 2009-06-22 14:41:03

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,454
Website GitHub

Re: Hidding Errors

lothar99

Tag trace FAQ. It might give you some clues as to whether there’s a missing ‘else’ statement or some other odd logic in your page that’s causing the error. BTW, are you using this kind of setup in your page:

<txp:ign_if_logged_in>
   ... Display some stuff including an article tag ...
<txp:else />
  ... Display 'Sorry, you need to be logged in to view this content' ...
   <txp:article pgonly="1" />
   <txp:ign_show_login />
</txp:ign_if_logged_in>

The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#7 2009-06-22 21:50:08

lothar99
Member
Registered: 2009-03-20
Posts: 35

Re: Hidding Errors

My page setup is like this:

<txp:rvm_privileged>
...protected content w/ article tag...
<txp:else />
...you aren't logged in page...
</txp:rvm_privileged >

I switched from testing to debugging for the tag trace and it shows this:

<!-- Runtime:    0.4456 -->
<!-- Query time: 0.244473 -->
<!-- Queries: 13 -->
<!-- Memory: 2283Kb, <txp:rvm_if_privileged> -->
<!-- txp tag trace: 
[SQL (0.0594131946564): select name, data from txp_lang where lang='en-us' AND ( event='public' OR event='common')]
[SQL (0.0081729888916): select name, code, version from txp_plugin where status = 1 AND type IN (0,1) order by load_order]
[SQL (0.0224151611328): Show tables like 'txp_bot_privs']
[SQL (0.0186290740967): select pref_name, pref_value from txp_bot_privs where 1=1]
[SQL (0.0117399692535): select ID,Section from textpattern where url_title like 'some-stuff-stuff-stuff' AND Section='premium-content' and Status >= 4 limit 1]
[SQL (0.00130987167358): select page, css from txp_section where name = 'Premium-Content' limit 1]
[SQL (0.00891494750977): select *, unix_timestamp(Posted) as uPosted, unix_timestamp(Expires) as uExpires, unix_timestamp(LastMod) as uLastMod from textpattern where ID=15 and Status in (4,5)]
[article 15]
[SQL (0.0179090499878): select ID, Title, url_title, unix_timestamp(Posted) as uposted
			from textpattern where Posted > '2009-02-27 01:50:00' and Section = 'Premium-Content' and Status=4 and Posted < now() and (now() <= Expires or Expires = '0000-00-00 00:00:00') order by Posted asc limit 1]
[SQL (0.00737690925598): select ID, Title, url_title, unix_timestamp(Posted) as uposted
			from textpattern where Posted < '2009-02-27 01:50:00' and Section = 'Premium-Content' and Status=4 and Posted < now() and (now() <= Expires or Expires = '0000-00-00 00:00:00') order by Posted desc limit 1]
[SQL (0.04647397995): select host from txp_log where ip='69.244.214.28' limit 1]
[SQL (0.001296043396): insert into txp_log set `time`=now(),page='/Premium-Content/some-stuff-stuff-stuff',ip='69.244.214.28',host='c-69-244-214-28.hsd1.fl.comcast.net',refer='',status='200',method='GET']
[SQL (0.00542306900024): select user_html from txp_page where name='default2']
[Page: default2]
<txp:rvm_if_privileged>
	[<txp:rvm_if_privileged>: false]
</txp:rvm_if_privileged>
[ ~~~ secondpass ~~~ ]
Tag error:  -> Textpattern Notice: Page template default2 does not contain a txp:article tag  on line 504
 -->

Now the error at the top of the page also gives more information:

Tag error: -> Textpattern Notice: Page template default2 does not contain a txp:article tag on line 504

textpattern/publish.php:504 trigger_error()
index.php:33 textpattern()

I don’t really know if that gives you any more idea what might be causing it.

Thanks for your help!!!

(added bc.s for better code display. -Els)

Last edited by els (2009-06-22 22:00:10)

Offline

#8 2009-06-22 21:57:15

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: Hidding Errors

Bloke wrote:

<txp:article pgonly="1" />

lothar99 wrote:

… but unfortunately its actually displaying the article when I place that tag on the page.

Actually I experienced the same behaviour yesterday… First I thought rvm_maintenance had something to do with it, but when I switched that off, the tag was still displaying the article… I’ll try and do some more testing on other sites and see if I can find out more.

Offline

#9 2009-06-22 22:02:29

lothar99
Member
Registered: 2009-03-20
Posts: 35

Re: Hidding Errors

Cool, thanks! Let me know if you find anything.

Btw, is there a more detail description of live vs testing vs debugging modes somewhere? I have read the little one on the page where u select the options before… but I don’t really know why the plugin would stop working in live mode.

Offline

#10 2009-06-22 22:16:56

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: Hidding Errors

Offline

#11 2009-06-22 22:25:41

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: Hidding Errors

About the pgonly="1": it’s only displaying the article on individual article pages. I’m now beginning to wonder if it might be intended behaviour…? (Posted here to find out.)

Last edited by els (2009-06-22 22:39:51)

Offline

#12 2009-06-22 22:58:19

lothar99
Member
Registered: 2009-03-20
Posts: 35

Re: Hidding Errors

Els wrote:

Production status.

Thanks. Based on this I don’t see any reason a plugin would not work in live mode but would work in debug/testing modes. Anyone have any ideas? I am assuming it is not properly reading the ign login cookie but have no idea why this would be…

Last edited by lothar99 (2009-06-22 22:59:00)

Offline

Board footer

Powered by FluxBB