Just now I discovered something anomalous when using DBA. (I haven't tested
yet whether this afflicts other backends.) For a while now a wiki I run would
occasionally be unable to load some (but not all) pages, and would fail as so:
Fatal Error:
lib/WikiDB.php:661: Error: <br />/home/uckelman/projects/phpwiki/lib/WikiDB.php:661: : Assertion failed <br />
The offending assertion is:
assert(is_string($pagename) and $pagename != '');
which I found quite perplexing. The problem isn't database corruption,
so far as I can see, since I can edit all of the pages which fail this
assertion and the text in the edit box is correct.
But when DEBUG is nonzero, this problem does not occur! Why?
Well, the assert is part of this bit of code:
if (DEBUG) {
if (!(is_string($pagename) and $pagename != '')) {
if (function_exists("xdebug_get_function_stack")) {
echo "xdebug_get_function_stack(): "; var_dump(xdebug_get_function_stack());
} elseif (function_exists("debug_backtrace")) { // >= 4.3.0
printSimpleTrace(debug_backtrace());
}
trigger_error("empty pagename", E_USER_WARNING);
return false;
}
} else
assert(is_string($pagename) and $pagename != '');
With DEBUG=1, for example, I get the "empty pagename" warning, but the page
outputs correctly, and I also get this notice, twice:
lib/stdlib.php:2028: Notice[8]: Array to string conversion
When $pagename is nonempty and not a string (the failure case) it comes
up in my test wiki as 'Array'.
Something's screwed up here... I'm going to mess with this some more this
evening. Any idea what might be wrong?
--
J.
|