User tests: Successful: Unsuccessful:
ob_end_clean raises a notice if the included layout file did something stupid (like running ob_get_clean()
!!!)
Notice: ob_end_clean(): failed to delete buffer. No buffer to delete in
/home/path/public_html/libraries/src/Layout/FileLayout.php
Battle tested code should check if a buffer exists before attempting to clear it, if by blindly clearing a non-existent buffer then raises a PHP Notice/Error/Warning/Fatal.
Install JEvents 3.6.12 on Joomla 4 beta 6
Visit https://example.com/administrator/index.php?option=com_jevents&task=params.edit
note that the file administrator/components/com_jevents/layouts/joomla/system/message.php is included by include $path;
and message.php runs a ob_get_clean()
within in.
This is probably a bug in JEvents because the ob_get_clean
should be two lines higher so it doesn't get run in Joomla 4 - but still Joomla should handle cleaning of output buffers better and never show Notices to the screen.
Notice: ob_end_clean(): failed to delete buffer. No buffer to delete in
/home/path/public_html/libraries/src/Layout/FileLayout.php
No errors
Status | New | ⇒ | Pending |
Category | ⇒ | Libraries |
Title |
|
Labels |
Added:
?
|
I tried a different test: added ob_get_clean(); at the end of com_media/layouts/toolbar/create-folder.php. That makes the toolbar button disappear. But stepping through with the debugger does not trigger any error when getting to ob_end_clean in the calling function. This with Beta7 pre Bootstrap 5. There is nothing in the error log. Sorry, can't test with Beta6.
System test always failing at the same place when trying to open Global Configuration for making changes. Not sure if related to this PR.
Closing as no interest. Lets hope its limited to one extension and not a bigger issue once Joomla 4 is released.
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2021-02-25 14:28:48 |
Closed_By | ⇒ | PhilETaylor |
Thanks @PhilETaylor for highlighting the miss-placed ob_get_clean() call in JEvents. Fixed for the next release
Your proposed change in Joomla 4 is a no-brainer, though it will probably be very rarely needed once Joomla 4 is released and extensions have been more widely tested.