Problem/Motivation
In production environments, the Tablefield module triggers a PHP warning when calling ob_clean() while no output buffer is active.
Steps to reproduce
This issue does not reproduce locally, likely due to differences in PHP configuration (e.g. output_buffering, zlib.output_compression) or execution order. When the output buffer may already be closed when Tablefield executes ob_clean(), resulting in the following warning:
ob_clean(): failed to delete buffer. No buffer to delete
This can cause noisy logs or, depending on error handling, break the request.
Proposed resolution
Wrap the ob_clean() call with a defensive check to ensure an active output buffer exists before attempting to clean it. For example:
if (ob_get_level() > 0) {
ob_clean();
}
Comments
Comment #2
zahord commentedPatch was attached
Comment #3
zahord commentedComment #4
liam morlandThanks for the patch. Please use an issue fork and merge request.