Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#61 2008-06-24 03:22:26

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

Re: rvm_maintenance (v0.5)

1. Any chance to make it MLP compatible to make it easy to translate the error message?

Mmm, MLP built-in conditionals (to check language) can be a solution if you can’t/don’t-want to make this feature.
So, don’t worry!


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#62 2008-06-24 15:35:23

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

Re: rvm_maintenance (v0.5)

maniqui wrote:

2. A more difficult one: is there any chance to remove/hide/avoid “debugging” messages for visitors (but keep displaying them for developers)? In other words, it’s a common scenario to be “in maintenance” and at the same time in “debugging” mode.

That’s outside the scope of this plugin.
It can be done, I think, by hooking in to the textpattern callback event and calling set_error_level with the desired production status. If this is just about suppressing debug messages caused by incorrectly used tags, then you could use my rvm_privileged plugin and conditionally execute a bit of PHP code that sets the error level.

Last edited by ruud (2008-06-24 15:36:07)

Offline

#63 2008-06-27 03:45:41

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

Re: rvm_maintenance (v0.5)

ruud wrote:

If this is just about suppressing debug messages caused by incorrectly used tags, then you could use my rvm_privileged plugin and conditionally execute a bit of PHP code that sets the error level.

Yes, I was thinking abut that: suppressing debug messages when the site is set both into “Debugging” productions status and “rvm_maintenance” activated.
But I was thinking in suppressing debug messages for the visitors (not logged in, not privileged, not interested in debug messages) and keeping them for the developer (logged in, privileged, interested in debug messages).

BTW, a tip (maybe already posted): using rvm_privileged and rvm_maintenance, it could be helpful to create a message on top of the page that reads “Site is in maintenance mode. Remember to de-activate rvm_maintenance when task is over.”

Something like this may work:

<txp:if_status status="503">
    <txp:rvm_if_privileged>
    <p>Site is in maintenance mode. Remember to de-activate rvm_maintenance.</p>
    </txp:rvm_if_privileged>
</txp:if_status>

La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#64 2008-06-27 06:57:21

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

Re: rvm_maintenance (v0.5)

hint: <txp:rvm_if_privileged> + <txp:else />
You may want to continue this in the plugin topic for that plugin.

Offline

#65 2008-12-01 18:45:43

Ruhh
Member
From: dakota dunes
Registered: 2008-01-20
Posts: 305

Re: rvm_maintenance (v0.5)

Hi,
It has been real long since I last came in here!
Anyway, just recently I installed version 4.0.7 for the first time. That went well.
Then installed this maintenance plugin, my only plugin and encountered errors such as this:

Tag error: <txp:if_section name='<txp:section />'> ->  Notice: Undefined variable:  s  on line 3027
textpattern/publish/taghandlers.php:3027 if_section()
textpattern/publish.php:1090 if_section()
textpattern/publish.php:1025 processtags()
textpattern/publish/taghandlers.php:1090 parse()
textpattern/publish.php:1090 section_list()
textpattern/publish.php:1025 processtags()
textpattern/lib/txplib_misc.php:1803 parse()
textpattern/lib/txplib_misc.php(574) : eval()'d code:8 txp_die()
rvm_maintenance()
textpattern/lib/txplib_misc.php:610 call_user_func()

Help would be much appreciated.


<txp:Ruhh />

Offline

#66 2008-12-01 19:32:36

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

Re: rvm_maintenance (v0.5)

Sarah, rvm_maintenance activates very early in the handling of the page request. At that point the $s section variable is not yet set, which causes the error. Do you need the if_section and section tags in that template?

Offline

#67 2008-12-01 22:12:43

Ruhh
Member
From: dakota dunes
Registered: 2008-01-20
Posts: 305

Re: rvm_maintenance (v0.5)

All I did was copy the template from the error_default page and paste into the error_503 page.

But I removed the if_section tags from the error_503 template. So thank you for that.


<txp:Ruhh />

Offline

#68 2009-01-04 23:50:39

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

Re: rvm_maintenance (v0.5)

I’m getting similar errors like Sarah, when in debugging mode. They disappear when in live or testing mode, but I’d like to turn debugging on while developing a site ;) I’m using 4.0.8rc1 (r3060), it didn’t happen in 4.0.7 but I’ve also made changes to the error_503 page shortly after the upgrade, so I don’t know if the errors appeared after the page changes or after the upgrade.
The article_custom tag that seems to be the culprit displays my article (id 4) without a problem. This is the relevant code on the page:

<txp:article_custom id="4">
	<div class="side_art">
	<div class="topbalk">
	<h4><txp:title /></h4>
	</div>
	<div class="inhoud">
	<txp:excerpt />
	</div>
	</div>
</txp:article_custom>

Errors:

Tag foutmelding <txp:article_custom id="4"> ->  Notice: Undefined index:  id  on line 885

textpattern/publish.php:877 parseArticles()
textpattern/publish.php:1090 article_custom()
textpattern/publish.php:1025 processTags()
textpattern/lib/txplib_misc.php:1794 parse()
textpattern/lib/txplib_misc.php(570) : eval()'d code:8 txp_die()
rvm_maintenance()
textpattern/lib/txplib_misc.php:606 call_user_func()
textpattern/publish.php:210 callback_event()
textpattern/publish.php:121 preText()
index.php:32 include()

Tag foutmelding <txp:article_custom id="4"> ->  Notice: Undefined variable: q  on line 585

textpattern/publish.php:887 doArticles()
textpattern/publish.php:877 parseArticles()
textpattern/publish.php:1090 article_custom()
textpattern/publish.php:1025 processTags()
textpattern/lib/txplib_misc.php:1794 parse()
textpattern/lib/txplib_misc.php(570) : eval()'d code:8 txp_die()
rvm_maintenance()
textpattern/lib/txplib_misc.php:606 call_user_func()
textpattern/publish.php:210 callback_event()
textpattern/publish.php:121 preText()

Tag foutmelding <txp:article_custom id="4"> ->  Notice: Undefined variable: q  on line 620

textpattern/publish.php:887 doArticles()
textpattern/publish.php:877 parseArticles()
textpattern/publish.php:1090 article_custom()
textpattern/publish.php:1025 processTags()
textpattern/lib/txplib_misc.php:1794 parse()
textpattern/lib/txplib_misc.php(570) : eval()'d code:8 txp_die()
rvm_maintenance()
textpattern/lib/txplib_misc.php:606 call_user_func()
textpattern/publish.php:210 callback_event()
textpattern/publish.php:121 preText()

Tag foutmelding <txp:article_custom id="4"> ->  Notice: Undefined variable: q  on line 708

textpattern/publish.php:887 doArticles()
textpattern/publish.php:877 parseArticles()
textpattern/publish.php:1090 article_custom()
textpattern/publish.php:1025 processTags()
textpattern/lib/txplib_misc.php:1794 parse()
textpattern/lib/txplib_misc.php(570) : eval()'d code:8 txp_die()
rvm_maintenance()
textpattern/lib/txplib_misc.php:606 call_user_func()
textpattern/publish.php:210 callback_event()
textpattern/publish.php:121 preText()

Tag foutmelding <txp:article_custom id="4"> ->  Notice: Undefined variable: q  on line 746

textpattern/publish.php:887 doArticles()
textpattern/publish.php:877 parseArticles()
textpattern/publish.php:1090 article_custom()
textpattern/publish.php:1025 processTags()
textpattern/lib/txplib_misc.php:1794 parse()
textpattern/lib/txplib_misc.php(570) : eval()'d code:8 txp_die()
rvm_maintenance()
textpattern/lib/txplib_misc.php:606 call_user_func()
textpattern/publish.php:210 callback_event()
textpattern/publish.php:121 preText()

Offline

#69 2009-01-05 07:39:07

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

Re: rvm_maintenance (v0.5)

Hmm.. I suppose I could initialize those variables in the plugin.

Offline

#70 2009-01-05 12:24:13

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

Re: rvm_maintenance (v0.5)

This would be very convenient. I ran into similar issues recently, and especially during “maintenance” it is very likely that debug mode is in effect.

Offline

#71 2009-01-05 21:21:21

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

Re: rvm_maintenance (v0.5)

Sarah, Els, Robert, please try rvm_maintenance v0.5

It triggers the error page using the pretext_end callback instead of the pretext callback, which ensures that various variables are initialized properly.
Note that the error page will behave as if you’re on the frontpage, even if you use an URL that contains a section, category, id etc. This is intentional.

Offline

#72 2009-01-05 21:37:42

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

Re: rvm_maintenance (v0.5)

Great! No more errors in debug mode. Thanks for the quick fix!

Offline

Board footer

Powered by FluxBB