View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0032866 | mantisbt | api rest | public | 2023-08-27 12:08 | 2025-01-31 19:20 |
Reporter | dregad | Assigned To | dregad | ||
Priority | normal | Severity | major | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Target Version | 2.26.0 | Fixed in Version | 2.26.0 | ||
Summary | 0032866: Allow REST API to run on PHP 8.1 without squelching E_DEPRECATED notices | ||||
Description | In 0031678 it was identified that, while Slim 3.x is not officially supported under PHP 8.1+, the framework only triggers some harmless deprecation warnings. The suggested workaround was to set the following in php.ini:
While waiting for the opportunity and time to upgrade to Slim 4.x (0031699), it would be nice to be able to be able to use the API without suppressing deprecation notices. This would e.g. allow running the PHPUnit tests locally during development, without having continually change error_reporting settings. The problem is that the API calls effectively fail, but report success (HTTP 200 status code) and the response body contains HTML with details about the errors. One possible approach would be to maintain our own fork of the offending components, like we did for PHPUnit 6.5 in April 2022, but that's a pain. Another potential solution would be to somehow catch the deprecation notices and make the REST API return an error status. Unfortunately, Slim's documented way of handling PHP errors is not able to catch these warnings, as some of them occur before the error handling container becomes active (while it's being initialized, in fact). | ||||
Tags | PHP 8.1 | ||||
related to | 0031699 | confirmed | Upgrade Slim Framework to 4.x | |
related to | 0031678 | closed | dregad | cannot fetch data with rest api after upgrade |
related to | 0032027 | closed | dregad | PHP 8.2 support |
related to | 0033173 | closed | dregad | No endpoints working on Windows server with PHP 8.1+ |
related to | 0035284 | resolved | dregad | Allow REST API to run on PHP 8.4 ignoring E_DEPRECATED notices |
MantisBT: master 1859ed6c 2023-08-27 11:24 Details Diff |
Travis: stop ignoring deprecated errors on PHP 8.1 Issue 0032866 |
Affected Issues 0032866 |
|
mod - .travis.yml | Diff File | ||
MantisBT: master 795ff02e 2023-08-27 12:10 Details Diff |
Catch Slim 3.x deprecated warnings on PHP 8.1 Introduce a custom error handler to capture selected deprecation notices and wrap the Slim initialization in a try/catch block. If any exception occurs, an HTTP 500 will be triggered. Fixes 0032866 |
Affected Issues 0032866 |
|
mod - api/rest/index.php | Diff File |