@Mark Hamstra - the first line here is line 690 in my local 2.7.0-pl install (it's in the setDebug method):
$debug = (is_int($debug) ? $debug : defined($debug) ? intval(constant($debug)) : 0);
if ($debug) {
error_reporting($debug);
parent :: setLogLevel(xPDO::LOG_LEVEL_INFO);
}
This happens in the modX class constructor:
$debug = $this->getOption('debug');
if (!is_null($debug) && $debug !== '') {
$this->setDebug($debug);
}
As I read it (the double ternary operators make it difficult to read), $debug is coming through as a string. Because it's a string, it fails the is_int(), test so defined($debug) executes. If the number in the debug System Setting is not a defined constant, the error gets thrown. It shouldn't, imo, because error_reporting() accepts a bitmask, so any integer, defined or not, should be allowed, and the description of the debug setting says any valid integer will work.
Maybe the is_int() should be is_numeric(), which would pass a numeric string.
Or maybe it should be this in the constructor:
$this->setDebug(intval($debug));
Another issue is that in the xPDO getOption() method, if the key is not a string or an array, the default value is returned. But the getOption() call in the modX constructor's debug section has no default.