Posts: 18
Threads: 5
Joined: Sep 2010
26-Sep-2010, 05:14 PM
Hi there,
when the maintenance mode is activated, the page source code is cut off after the maintenance message.
I guess it's because you let the php file die in the "check_maintenance" function (comments/includes/functions/page.php).
Wouldn't it be better if you switch off the comments display by using a "if then" question?
Bye
... Gert
Posts: 2,873
Threads: 59
Joined: Jun 2010
Hi,
That's right, the maintenance feature uses the die() function to end scripting.
I can see how that could be a problem, like if you have code afterwards that you want run.
It will be fixed in the next version.
Have
you completed
the interview?
Posts: 535
Threads: 31
Joined: Jul 2010
Yeah, I was meaning to report that quite a while ago, but I then forgot. This would break things like php footers and such. How do you plan on circumventing this? Defining a constant that will stop execution of the script when set?
I'm giving you three guesses...
Posts: 2,873
Threads: 59
Joined: Jun 2010
I'll change the check_maintenance() function to return true or false. An if-else statement will be wrapped around the remaining code in commentics.php. If false, it will run the code. If true, it will call a function like show_maintenance().
Have
you completed
the interview?
Posts: 535
Threads: 31
Joined: Jul 2010
What about the other die() functions?
I'm giving you three guesses...
Posts: 2,873
Threads: 59
Joined: Jun 2010
There's only the ban function as far as I know.
Have
you completed
the interview?
Posts: 2,873
Threads: 59
Joined: Jun 2010
Is it a problem that the ban function kills the scripting?
Have
you completed
the interview?
Posts: 535
Threads: 31
Joined: Jul 2010
Actually, I think that the various checks for page validity also have die() functions. Try an invalid page id.
I'm giving you three guesses...
Posts: 2,873
Threads: 59
Joined: Jun 2010
Ah yes, you're right.
Although really one should never experience those checks, unless of course they mess up the integration. Even then, it shouldn't be a persistent thing.
I think the maintenance feature is slightly different because it's meant to be displayed to people, and could be displayed for a while.
Still, I'll look into making the same fix.
Have
you completed
the interview?