User tests: Successful: Unsuccessful:
Pull Request for Issue #18088
Add back the check to clear the buffered output. cc @SharkyKZ
Enter non-existing url in browser to trigger 404 page.
Default template error page should be displayed, as usual.
Default template error page should be displayed, as usual.
None
Status | New | ⇒ | Pending |
Category | ⇒ | Libraries |
Ok will do when i'm back at my PC.
Labels |
Added:
?
|
Thanks @ethernidee this has just been commited to this PR.
I have tested this item
Default template error page should be displayed, as expected.
Tests are failing.
/drone/src/tests/unit/suites/libraries/cms/error/JErrorPageTest.php:79
/drone/src/tests/unit/suites/libraries/cms/error/JErrorPageTest.php:123
Such things cannot be tested if buffer is cleared properly. The tests are invalid, imho.
Such things cannot be tested if buffer is cleared properly. The tests are invalid, imho.
What is the point of clearing the buffer there anyway?
Imagine you render Joomla module. First level of buffer capturing is on. Then in module template you write ob_start() for internal subwidget. If any error happens, Joomla will clear second level buffer and leave top of the default template rendered + will add error page html. This is totally wrong. All buffer levels should be cleared before rewriting the whole response, whether it's json or html response.
I faced such situations on working sites and was really surprised.
Makes sense, thanks
The latest commits make sure the test suite passes as it starts the output buffer right after we cleaded it again. Else that thing will fail as the output puffes is clreandend but not restarted.
Excellent solution!
Status | Pending | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2021-01-19 13:52:52 |
Closed_By | ⇒ | richard67 |
Thanks!
The following code:
should be replaced with: