Last modified: 2013-11-14 14:31:53 UTC
The following notice is not useful, because it does not name the caller nor give a backtrace. [03-Nov-2012 10:49:34 UTC] PHP Notice: TextContent constructed with $text = false! This may indicate an error in the caller's scope. [Called from TextContent::__construct in /www/translatewiki.net/w/includes/content/TextContent.php at line 37] in /www/translatewiki.net/w/includes/debug/Debug.php on line 283
This uses wfWarn to issue a warning. If you want a traceback, set $wgDevelopmentWarnings to true. That triggers a PHP warning, which will be rendered to page output and/or written to the error log. Where and when a traceback is included with a logged warning is a matter of configuring mediawiki and php. Naming the caller is not practical, since the caller may just as well be ContentHandler::makeContent or something similarly unhelpful. To find the "interesting" caller, you really need a full stack trace. Closing as WFM, because with $wgDevelopmentWarnings I see a stack trace. Note that $wgDevelopmentWarnings is enabled automatically in unit tests.
I'm sorry but what you are saying is not correct. 1) wfWarn has offset parameter to specify the caller. It might not always be useful, but showing TextContent::__construct is certainly not helpful. 2) $wgDevelopmentWarnings only decides whether to show the warning or not. By reading the code we can see that wfWarn calls only either wfDebug or trigger_error, and neither displays the backtrace with any MediaWiki configuration. 3) The only way to get PHP print backtraces for warnings and errors is the xdebug extension, which I don't have.
For 1) i could set the offset to 2, which will provide slightly more info in some cases, but I doubt that it would be useful. Items 2) and 3) are general issues with MediaWiki's warning/logging system. That could be improved, but that's unrelated to the issue at hand.
1) would be enough for me to close this bug. Another bug would be to optionally use wfBacktrace() in wfWarn.