pegasus
Well-known member
- Affected version
- 2.1.7
When an expected XML response instead throws a PHP error, the existing output is not as useful as it can be for debugging. The stack trace lists files and line numbers, but the actual error that was thrown does not, so the line that has a problem is not specified. I temporarily fixed this on my test board by making the following edit to src/XF/Mvc/View.php.
Find:
Replace with:
Find:
Code:
$rootNode->appendChild(
\XF\Util\Xml::createDomElement($document, 'error', $exceptionMessage)
);
Code:
$errNode = \XF\Util\Xml::createDomElement($document, 'error', $exceptionMessage);
$errNode->setAttribute('file', $e->getFile());
$errNode->setAttribute('line', $e->getLine());
$rootNode->appendChild($errNode);